Repository navigation
st-theme-node: Disconnect from StTheme by handler id - #14159
Open
SeniorMatt wants to merge 1 commit into
Open
SeniorMatt wants to merge 1 commit into
SeniorMatt wants to merge 1 commit into
Conversation
g_signal_handlers_disconnect_by_func() walks every handler connected to the theme, and every theme node connects one. Disposing many nodes at once (opening the menu, style changes on a large tree) is quadratic and showed up as ~10% of Cinnamon's CPU time while opening the menu. Store the handler id and use g_clear_signal_handler() instead, as GNOME Shell does (gnome-shell fb04dafb0).
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.
Each StThemeNode connects to its StTheme, and dispose used
g_signal_handlers_disconnect_by_func(), which walks every handler on the theme. When many nodes are disposed at once, that adds up: around 10% of Cinnamon's main thread in perf while opening the menu on a power-saver laptop.This keeps the handler id and uses
g_clear_signal_handler(), same as GNOME Shell did in fb04dafb0.Found with perf on Mint 27 (Wayland), on a ThinkPad T14s Gen 2 in power-saver mode.