Cinnamon and the slow menu from the stoneage

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.

Does your Cinnamon-menu pop up INSTANTLY, without the slightest lag or delay?

Instantaneous - I have an nVidia graphics card
31
17%
Instantaneous - I have an AMD Radeon graphics card
16
9%
Instantaneous - I have Intel HD Graphics
16
9%
Instantaneous - I have something else
0
No votes
Lags with delay - I have an nVidia graphics card
41
23%
Lags with delay - I have an AMD Radeon graphics card
27
15%
Lags with delay - I have Intel HD Graphics
39
22%
Lags with delay - I have something else
10
6%
 
Total votes: 180

Redsandro
Level 4
Level 4
Posts: 201
Joined: Sun Jul 17, 2011 6:40 pm
Contact:

Re: Cinnamon and the slow menu from the stoneage

Post by Redsandro »

@davidoide @joequant Thanks. The original authors didn't care much for using comments in their code. :/ Is it written by humans or generated by some other script or tool?

And what javascript implementation is this? const and let are not javascript spec.
esteban1uy wrote:I think you're probably affected by the "emulated shaders" problem introduced by the new Mesa.
I tested it out, but as expected by observation ((a) default style has no shadows and (b) delay seems to vary) this appears not to be the case.

Unless I made a typo, here's verifying the environment was updated properly:

Code: Select all

$ echo $COGL_DEBUG
disable-glsl
🤘 Amp.lol. No bloat, just radio.
Ninite-killer. 1000+ packages.
Redsandro
Level 4
Level 4
Posts: 201
Joined: Sun Jul 17, 2011 6:40 pm
Contact:

Re: Cinnamon and the slow menu from the stoneage

Post by Redsandro »

@joequant I tested out your github version and for me there is no noticeable difference. If any, the first menu-open after booting took even longer, but that could be random.

Although I think it is clear, especially with the first and longer delay, that this is CPU- and maybe other resources related. There is a 5 second spike in CPU usage when there is a 5 second menu delay. The follow-up half second delays also spike somewhat but it is too short to measure with a simple resource applet.

It is true though that I have quite some extra programs installed. So I am curious if the people with instant menu also have the least amount of extra packages installed?

To see if this is relevant, would you Mint colleagues be so kind to post your non-default package count?

Post in one line in large/bold (for overview purposes) [yes|no] <non-automatic package-count> like so:

yes (I have a lag/delay in the menu) or no (the menu displays instant) and then the output of this command:

Code: Select all

aptitude search '!~M ~i' -F '%p' | wc -w
For me that is:

yes 2034
🤘 Amp.lol. No bloat, just radio.
Ninite-killer. 1000+ packages.
joequant

Re: Cinnamon and the slow menu from the stoneage

Post by joequant »

It's an internal gnome javascript implementation

http://stackoverflow.com/questions/8078 ... umentation

I don't know much about it myself, so any bits of documentation would be helpful. I'm looking for some sort of firebug like debugger. This looks interesting...

https://live.gnome.org/GnomeShell/LookingGlass

The fix that I put in corrects an O(N**2) search. What happens when the menu adds a new application is that it looks over the existing apps to see if there is a duplicate with a linear search so you end up with O(N**2) behavior. I replaced the search with a hash table which gives you O(N) behavior. It helped my ASUS netbook a lot.

There are probably more inefficiencies in the javascript code. One big one is that I think it's calling refreshApp too often. It really should only refresh the app buttons when there are new apps added/removed, but unfortunately, when anything changes (i.e. recent documents), it reloads all of the apps.

One other tool, I've been trying to get compiled is Bugle

http://www.opengl.org/sdk/tools/BuGLe/

This should help with debugging issues in the OpenGL code.

One good thing about this is that I very strongly suspect that the problem is with the menu applet and it's not a general problem with the cinnamon infrastructure.

I have order 1000 applications. I accidentally stumbled on a fix when I was installing a new machine, and the menu was lightning quick with 50 apps.
Redsandro
Level 4
Level 4
Posts: 201
Joined: Sun Jul 17, 2011 6:40 pm
Contact:

Re: Cinnamon and the slow menu from the stoneage

Post by Redsandro »

I don't know if the script 'launches' everytime or if it's an 'always-on' script, but it really aught to have a menu ready at all times, and instantly show it when it is activated. Any kind of updating, adding apps, checking dupes, playing secret invisible pinball games do not concern the user and should happen anywhere, anytime but not when the user wants to see the menu.

It's indeed unfortunate that a big open source project is so badly commented. I almost have a harder time understanding the Cinnamon-menu than I have with John Carmack's Doom 3 source code. At least 30% of his code is comments about how and why.
🤘 Amp.lol. No bloat, just radio.
Ninite-killer. 1000+ packages.
esteban1uy

Re: Cinnamon and the slow menu from the stoneage

Post by esteban1uy »

Redsandro wrote:I tested it out, but as expected by observation ((a) default style has no shadows and (b) delay seems to vary) this appears not to be the case.
I'm sorry it didn't work for you, but the suggestion was intented for davidoide, because he expressed in a previous post he has a asus eeepc 1018p. Those machines come with a GMA 3150 GPU, that are known to have some problems with GLSL.
On the other hand, the shadows in a theme have nothing to do with GLSL vertex or pixel shaders, they are fully implemented in Cairo using Cogl offscreen buffers, as you can see at the source code: https://github.com/linuxmint/Cinnamon/b ... -drawing.c (just follow the st_theme_node_paint fuction to see how a Cinnamon element is painted). But the scroll-view controls (like in the scroller at Cinnamon menu) use an effect implemented by means of glsl shaders: https://github.com/linuxmint/Cinnamon/b ... iew-fade.c
Redsandro
Level 4
Level 4
Posts: 201
Joined: Sun Jul 17, 2011 6:40 pm
Contact:

Re: Cinnamon and the slow menu from the stoneage

Post by Redsandro »

My mistake. :mrgreen:

I speed-read everything as possible general solutions and give feedback when they are ineffective.
Didn't catch the specificness but I hope it works for davidoide.
🤘 Amp.lol. No bloat, just radio.
Ninite-killer. 1000+ packages.
davidoide

Re: Cinnamon and the slow menu from the stoneage

Post by davidoide »

Redsandro wrote:My mistake. :mrgreen:

I speed-read everything as possible general solutions and give feedback when they are ineffective.
Didn't catch the specificness but I hope it works for davidoide.
Hi, I'ive been reading all your answers, it's very nice of you.
Unfortunately I can't follow your technical hypotheses or provide any suggestions, I'm not familiar with any programming language (except matlab, but I don't think it counts....)

For what concerns my cinnamon-menu situation I'm stack with a 2-3 sec delay on boot and 0.5-1 sec lag from the second time on.
If I don't open the menu for several minutes the lag becomes more noticeable, but not as much as on cold boot.
I have also noticed that the scrolling of all applications in the menu is jerkely.

I'm pretty satisfied with the overall behaviour of the cinnamon-mint synergy, although as a newbie user I find annoying to see some things working very fast and others (maybe more frequently used) too slow also for a basic configuration like mine.

For Redsandro
yes 1713
esteban1uy

Re: Cinnamon and the slow menu from the stoneage

Post by esteban1uy »

davidoide wrote:I have also noticed that the scrolling of all applications in the menu is jerkely.
Did you already try this?: http://forums.linuxmint.com/viewtopic.p ... 20#p655002

No changes?
davidoide

Re: Cinnamon and the slow menu from the stoneage

Post by davidoide »

esteban1uy wrote:
davidoide wrote:I have also noticed that the scrolling of all applications in the menu is jerkely.
Did you already try this?: http://forums.linuxmint.com/viewtopic.p ... 20#p655002

No changes?
Yes, I did. I think that it has helped a little. At the moment I have used joequant fix and yours. The delay on cold boot I'm quite sure was higher without any fix (4-5 sec, now 2-3) while the lag in the subsequent opening is maybe reduced a little, and it's acceptable now. Instead the scrolling problem is very annoying...it's better to use the search directly
gibbs1984
Level 5
Level 5
Posts: 825
Joined: Mon Oct 27, 2008 2:40 pm
Location: Hemel Hempstead, England

Re: Cinnamon and the slow menu from the stoneage

Post by gibbs1984 »

Yes - 1714.

I've tried the code changes on the previous page and it seems a bit faster now, not much though. Although that could just be a placebo effect...

Will monitor this thread though on the hope there is a permanent fix :)
Linux Mint 20.3 (Cinnamon) 64bit.
Redsandro
Level 4
Level 4
Posts: 201
Joined: Sun Jul 17, 2011 6:40 pm
Contact:

Re: Cinnamon and the slow menu from the stoneage

Post by Redsandro »

I just spent 2 hours with /usr/share/cinnamon/applets/menu@cinnamon.org/applet.js but couldn't get it to act nicely.
It doesn't help that there is
  • Hardly explanatory comments
  • Hardly any clear or complete documentation as far as I can google
  • Custom javascript implementation
I tried and failed. So my hope is being very specific about the problem and letting the devs know.

If you have a github account, please confirm problems and test patches at:
https://github.com/linuxmint/Cinnamon/issues/1389
An issue with a lot of talk is an issue with a lot of gravity.
Last edited by Redsandro on Thu Dec 27, 2012 5:50 pm, edited 1 time in total.
🤘 Amp.lol. No bloat, just radio.
Ninite-killer. 1000+ packages.
aceleron

Re: Cinnamon and the slow menu from the stoneage

Post by aceleron »

Pointedstick wrote:Is it possible that you guys who are experiencing lag are using Cinnamon themes that explicitly introduce a delay or fade the menu in slowly or something? I noticed while I was trying different themes that some were much faster than others to open the menu.
I can confirm this. In my case themes like Cinnamon or OMG has a fade effect when menu show up or when disapear. Then, I tried other themes like Gnome or Loki and menu apperars more, more faster than before.

Now I using Lki theme and menu appears quickly.

Thanks for advice. :!:
Redsandro
Level 4
Level 4
Posts: 201
Joined: Sun Jul 17, 2011 6:40 pm
Contact:

Re: Cinnamon and the slow menu from the stoneage

Post by Redsandro »

Faster themes or not, the slowness is in fact known problem that cannot seem to get fixed upstream (Shell) or downstream (Cinnamon).
You either need a supercomputer or a large tolerance for lag not to notice this.

https://github.com/linuxmint/Cinnamon/issues/1389
🤘 Amp.lol. No bloat, just radio.
Ninite-killer. 1000+ packages.
mockturtl

Re: Cinnamon and the slow menu from the stoneage

Post by mockturtl »

Redsandro wrote:And what javascript implementation is this? const and let are not javascript spec.
It's spidermonkey, so you can use mozilla's documentation.

The new syntax is supposed to be js.next or ECMA6 or TC39 -- I don't think the vendors have agreed on how to count, or much else, but the name is definitely "Harmony" -- and it'll be right along, one of these years.
joequant, #1389 wrote:Any suggestions for profiling/debugging tools. Will global.log just dump things to STDOUT?
You can enable logging to a file. (cinnamon-settings -> General)
bimsebasse

Re: Cinnamon and the slow menu from the stoneage

Post by bimsebasse »

I hate lag and have a non-special 2010s laptop - yet my menu opens fast! :D

Doesn't that just make your day, redsandro?
Redsandro
Level 4
Level 4
Posts: 201
Joined: Sun Jul 17, 2011 6:40 pm
Contact:

Re: Cinnamon and the slow menu from the stoneage

Post by Redsandro »

@mockturtl Thanks, didn't know that. It's not my favorite year when that spec becomes universal ecma because I don't like the extra keywords but if it serves a cause it's probably a good idea.

@bimsebasse Nope, it just pisses me off because it makes me seem like an idiot with imaginary problems. :P

Luckily the devs working on the problem acknowledge it. :)
🤘 Amp.lol. No bloat, just radio.
Ninite-killer. 1000+ packages.
bimsebasse

Re: Cinnamon and the slow menu from the stoneage

Post by bimsebasse »

There's a difference between not acknowledging an issue and reacting to the annoying common fallacy of "x doesn't work well for me = x doesn't work well for anyone", and it's not a fine difference.
Redsandro
Level 4
Level 4
Posts: 201
Joined: Sun Jul 17, 2011 6:40 pm
Contact:

Re: Cinnamon and the slow menu from the stoneage

Post by Redsandro »

Agreed. Although there is also a difference between "x doesn't work well for me = x doesn't work well for anyone" and the even more annoying "x works well for me = you probably made a configuration error on your end", and I am not sure if you mean me with your statement because I have already established that "x doesn't work for me and in this case about half of the users here", but the problem has been identified and acknowledged in the bugtracker, and although I am unsure how a structural problem like that could leave half the Cinnamon population unaffected, I appreciate the attempts that are being made to fix this.
🤘 Amp.lol. No bloat, just radio.
Ninite-killer. 1000+ packages.
bimsebasse

Re: Cinnamon and the slow menu from the stoneage

Post by bimsebasse »

It's a well-known problem, it often receives (attempts at) fixes in the development version of Cinnamon, no one is denying it or neglecting it, no one has any problem with it not being denied or neglected....
Redsandro
Level 4
Level 4
Posts: 201
Joined: Sun Jul 17, 2011 6:40 pm
Contact:

Re: Cinnamon and the slow menu from the stoneage

Post by Redsandro »

Not in Cinnamon, but there are questionable API decisions upstream that the javascript depends on, and I hear left and right that it's quite the challenge to get patches accepted into the GNOME core.
🤘 Amp.lol. No bloat, just radio.
Ninite-killer. 1000+ packages.
Locked

Return to “Cinnamon”