Skip to content

st-theme-node: Disconnect from StTheme by handler id - #14159

Open
SeniorMatt wants to merge 1 commit into
linuxmint:masterfrom
SeniorMatt:st-theme-node-signal-disconnect
Open

SeniorMatt wants to merge 1 commit into
linuxmint:masterfrom
SeniorMatt:st-theme-node-signal-disconnect

Conversation

@SeniorMatt

Copy link
Copy Markdown

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.

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant