Boosting the Real Time Performance of Gnome Shell 3.34 in Ubuntu 19.10

That’s going off topic a little because it’s a bug and not directly performance related. I think this bug is what you want to subscribe to, and a partial fix is pending upstream. A proper fix would indeed need to come from each app/toolkit. It should not be discussed here.

1 Like

sway and wlroots both implemented nearest neighbour scaling for integer scaling factors and it works wonderfully. Apps look sharp - you can tell it’s not native if you really look hard (pixelation) but it makes IDEs usable on scale 2 displays.

Linear scaling on text is a sure way to give you a headache in minutes. If you write code 8 hours a day like I do it’s a no-go.

Regarding Wayland multi-monitor work,

Bad news: It’s arguably too late in the release schedule for me to attempt core changes I haven’t started on yet.

Good news: The mutter maintainer is working on it anyway, despite being late in the cycle.

1 Like

Google Profiler is a profiler like gprof or callgrind, but the one Google has made freely available is different because it is stochastic and has some useful tricks. One such trick is that you can ask it to measure real time usage instead of the default CPU time usage

There’s also perf that is developed together with the kernel. It has lots of options to measure. What the article called a “real time” can be measured like this.

It’s only risky to introduce to a large project that already relies on being single threaded

I wish more people learned pure functional programming (preferably Haskell), and employed its techniques in whatever language they use. That would really improve maintainance of whatever they’re writing. In particular adding a multithreading to a single-threaded large project written in an imperative language would be much less of a problem.

@vanvugt I know this is asking a lot, but could you explain in a few (and if possible simple) words your recent work in improving the overview animations? As I’ve said before in my 4K screen that’s by far the worst part of the shell and I would like to understand your approach but I’m unable to figure out it from reading the PRs since I’m not an expert on the subject.

@memeplex,

That would probably be best explained in a new article/topic I was thinking about writing to talk about what is/will be in 20.04.

In short, most of the overview animation fixes involve changing animations of ClutterActor x/y properties to translation-x/translation-y properties. The latter are much faster because they don’t’ incur relayouts (which doesn’t seem to be documented). Relayouts are super slow in gnome-shell because they involve calling allocate on all the actors and in gnome-shell those vfunc_allocate functions are mostly written in JavaScript. It turned out to be a little too much JavaScript to be usable in real time animations.

The other fix is in gjs. That involves making all JavaScript code faster in gjs 1.63.91 (coming to Ubuntu 20.04 soon).

Both of these issues are covered by this Ubuntu bug. About half of it has landed in 20.04 so far though the bug doesn’t show that very well. You will need gnome-shell 3.35.92 and gjs 1.63.91 to get all the overview animation performance fixes.

4 Likes

I do use Focal with GS/Mutter 3.35.91 and clearly already I can see GS is in better shape.
Daniel, question : I noticed my laptop runs IDLE now at 2.9 W instead of 3.4 W some days (weeks ?) ago. Do you think it’s GS/Mutter’s upgrade that caused such a lower power usage ? Or the newer 5.4 kernels ?

1 Like

Thank you very much for the clarifications, Daniel, and of course for you consistently great work.

1 Like

@fthx,

While yes there have been some efficiency improvements in gnome-shell, the only one I can think of right now isn’t even released yet – it’s part of 3.35.92. The lower power usage could be due to anything including the kernel.

1 Like

Actually it looks like there’s more work to be done even after gnome-shell 3.35.92 and gjs 1.63.91. Because everything I’ve done so far has been for upstream and I now notice Ubuntu is a bit slower so I’ll need to spend some time figuring out if any of the Ubuntu extensions are slowing things down.

2 Likes

The appindicator extension is a good place to start. Massive slowdowns when used with electron apps, can’t even have it installed when i’m using discord. Some people also notice memory leaks from it.

2 Likes

I’m commenting here because there isn’t a thread specific of 20.04 yet.

I’ve been trying the beta and I found that the overview animation is still dropping frames and noticeably “stuttering” in my laptop. That said, I find it weird because both in Arch Linux and in Fedora 32 (beta) shell performance is really good, the improvement wrt 3.34 is obvious, specially in a Wayland session. Now, being suspicious of extensions, I tried a vanilla gnome-session but to no avail, still clunky performance, I would say worse than that I get in 19.10. Any idea of what can be causing it, @vanvugt? I’ve an Intel 620 card (also a NVIDIA gpu that I’m not using in any of the aforementioned setups).

+1, running recent ThinkPad intel 620 GPU only, Gnome session, me too. If I can remember all the dev cycle, there was a moment where the animations were better than now.
It’s quite noticeable when showing the workspaces dock in overview.

1 Like

@memplex,

Please be sure to update your system first:

sudo apt update
sudo apt full-upgrade
sudo reboot

Now if the problem still exists please log a new bug about the performance problem by running:

ubuntu-bug gnome-shell

And in a related PSA: Everyone please ensure you don’t log bugs against gnome-shell while you have any non-Ubuntu extensions installed. It will just take extra time as we ask for them to be removed.

I don’t want to ask to be more overwhelmed than we already are with Beta bug reports, but we haven’t yet received any bug reports about performance regressions in Gnome Shell 3.36. :crossed_fingers:

And yes I will start a new topic in the coming weeks about what’s new with Gnome Shell 3.36 performance.

6 Likes

Daniel, GS 3.36 Wayland / Ubuntu 20.04 is a great combo. Very very few GS crashes during dev cycle, better rendering of animations and, last but not least, a huge gain in power usage (Thinkpad T480s). Bottom line : the perf issue I experience (iGPU) is random. Most of the time the overview animations are smooth ; sometimes they aren’t. I really don’t know what’s causing this, it’s not related to the system charge or any extension I use. So it’s very hard to make an useful bug report.

1 Like

Seeing the same thing with 20.04 on a Dell XPS13 9360, with a Intel HD620. The applications animation (the icons coming from the bottom left) in specially stuttery most of the time. Sometimes it is buttery smooth, but most of the times not. It is difficult to pinpoint when.

I also have a desktop with 20.04 and a Nvidia 750ti and it seems to be much smoother. This seems to indicate that the problem is somehow related to the Intel iGPU.

As another datapoint: animations seem smoother under Wayland. But, because of other limitations, I am staying on Xorg for now.
Also, the application animation is super stuttery the first time it is opened in a session. It gets slowly better with subsequent uses, although never totally smooth.

Yet another datapoint: the animation is noticeably more stuttery if it opens the “All” applications tab instead of “Frequent” apps. Maybe the number of apps (icons) is a factor?