Shell.GenericContainer is a workaround added back in time to allow overriding the size negotiation vfuncs (
Over time, however, GJS gained the ability to override vfuncs, but the workaround was never removed. This merge request removes all the usages of Shell.GenericContainer throughout the codebase.
Shell.GenericContainer exposes the size negotiation machinery through the use of signals. Signals are not specially performant. One of the reasons is that they acquire a global lock for signal handlers lookup. GNOME Shell has more than 2,000 actors at any given point in time, up to 20 levels deep in hierarchy, making size negotiation and painting non-trivial tasks. Such a critical section of Clutter's machinery shouldn't rely on signals whatsoever.
Besides that, Shell.GenericContainer is a workaround to a non-existing issue anymore. It shouldn't be used anyway, regardless of any performance improvements that removing it can potentially yield.
St.Widget subclasses. That way, it was possible to override the size negotiation vfuncs.
foo.actor usages were converted to only
The commit messages, in particular the first ones, expose the challenges and solutions of removing this class. Fortunately, no outstanding hacks were introduced, and overall the code looks cleaner.
This merge request may have a small but consistent performance benefit. In average, the framerate became more stable and predictable. In addition to that, it became slightly shorter. That leads to better framerate measurements over time:
Shell.GenericContainer, the framerate is more unstable compared to this branch. There are moments where the framerate matches this work, but most of the time, it sits comfortably below it. Early results give an improvement of about 3~6 FPS when running GNOME Shell animations, like the spring animation of the Icon Grid, or moving in and out of the Overview.
Other random findings:
- The icon grid itself loads faster with this branch. This is the first data point in the graph.
- There are still stutterings when running the app grid spring animation, but they're apparently shorter and less proeminent. It is likely that this will be most affected by !22 (merged).
- Overview animations are smoother with lots of windows opened here.
- Fix remaining issues
- Measure performance improvements
- Test more