Repository navigation
Conversation
UiActor.vfunc_paint() painted every child of uiGroup from JS. uiGroup has dozens of children (62 in a default session, over 100 after a day of use), almost all of them hidden tooltips and menus, so each frame paid one JS -> C call per child, each marshalling the ClutterPaintContext. When skip_paint_actors is empty - the normal case - chain up to StWidget, whose paint lets ClutterActor walk the children natively. The JS loop is kept for the case where some actor is skipped. Measured on current master (muffin 192cd42, cinnamon c3e2d34, nested Xephyr session, window animating at 60 fps), instructions of the Cinnamon main thread per frame: 1.66M / 1.68M before, 0.77M / 0.76M after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
rumours86
force-pushed
the
uiactor-native-paint
branch
from
October 14, 2026 01:22
3d98b3d to
5a1756e
Compare
Contributor
Author
|
The Mint 22 job fails before compilation, while Correction to my earlier explanation: Codespell runs with |
Keep the native traversal available when all skipped actors are unmapped. Clear skip membership when Chrome untracks an actor so paint never queries disposed wrappers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UiActor.vfunc_paint()callschild.paint()from JS for every child ofuiGroup, including hidden tooltips and menus. Each call marshals aClutterPaintContext; a profile with a continuously redrawing window put about 9% of Cinnamon's CPU time ingjs_value_from_g_argumentalone.Chain up to
StWidgetso that Clutter traverses the children natively whenever no mapped actor needs to be skipped. Unmapped actors are already ignored byClutterActor.paint(), so they do not need to disable this path. Keep the original JS loop when a mapped skipped actor exists.uiGrouphas no style, so the background part ofStWidget.paint()draws nothing. Picking is unchanged.The first version checked only whether
skip_paint_actorswas empty. In a longer desktop session I found 278 children, only six mapped, with two unmapped actors in the skip set; those two actors prevented the fast path on every frame. Also clear skip membership inChrome._untrackActor(), while the actor is still alive, so subsequent paints do not callis_mapped()on a disposed wrapper.Initial fast-path measurements, before the mapped-skip extension: muffin
192cd42, Cinnamonc3e2d34, cinnamon-desktop6c6c48d, nested Xephyr session and a GTK window redrawing at 60 fps. Main-thread userspace instructions (perf stat -e instructions:u -t), divided by 60 frames/s, in A/B/A/B order:Validation of the extension:
UiActorand Chrome methods covers destroy, explicit untrack followed by destroy, remove followed by destroy, and reparent followed by destroy. Without skip cleanup, each case emits disposed-object criticals on subsequent paints; with cleanup, all four cases leave an empty skip set and take the native path without those criticals. The parent paint is a counter in this harness, so this tests lifetime and branch selection rather than framebuffer output.For the original nested test build only, the background daemon was made optional because this Mint 22.3 installation lacks master's GTK >= 4.18 dependency, and the
files/installation destination was adjusted. Those build changes are not part of this PR. On the updated head (7c0c775), LMDE 7 and Mint 27 builds, Pattern Check and CodeFactor pass. Mint 22 repeats the existing failure inmk-build-deps, during build-dependency installation and before Cinnamon compilation; its log does not identify the individual unmet dependency.