Skip to content

perf(label): skip redundant markup updates#5111

Open
SaveTheRbtz wants to merge 1 commit into
Alexays:masterfrom
SaveTheRbtz:codex-label-update-hotpath
Open

perf(label): skip redundant markup updates#5111
SaveTheRbtz wants to merge 1 commit into
Alexays:masterfrom
SaveTheRbtz:codex-label-update-hotpath

Conversation

@SaveTheRbtz

Copy link
Copy Markdown

Summary

  • Add ALabel helpers that skip identical label and tooltip markup writes.
  • Use them in hot sway/window and mpd label paths.

Why this was needed

baseline.perf.data had visible GTK/UI update work. The GTK layout/draw-ish path accounted for about 213M cycles, which is avoidable when a module writes identical markup repeatedly.

Change

Cache the last label and tooltip markup in ALabel. Skip Gtk::Label::set_markup() and set_tooltip_markup() when the new markup is unchanged.

Effect in comparison

GTK layout/draw-ish work drops from 213M to 17M cycles, indicating fewer no-op relayout/redraw paths.

Testing

  • ninja -C build
  • meson test -C build

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