perf(ui): cache paint state across widgets and add missing pyqtSlot coverage - #245
Open
gmmcosta15 wants to merge 17 commits into
Open
perf(ui): cache paint state across widgets and add missing pyqtSlot coverage#245gmmcosta15 wants to merge 17 commits into
gmmcosta15 wants to merge 17 commits into
Conversation
…SIP enum in screensaver
gmmcosta15
marked this pull request as draft
July 3, 2026 15:31
…g pyqtSlot decorators
gmmcosta15
marked this pull request as ready for review
August 24, 2026 14:16
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.
Description
Eliminates repeated per-frame CPU work in the paint-hot paths and event dispatchers.Measured on target hardware:
paintEventCPU down 57% (py-spy, 300s at 100Hz on RF50 / Raspberry Pi 5 aarch64, 160 -> 69 samples, 6.0 sigma, replicated), or 0.53% -> 0.23% of one core.paintEvent, across the button, label, slider, progressbar, toggle, list and popup widget sets plusscreensaverandlist_model.repaint()calls withupdate()where a synchronous flush was not required.update(QRect)instead of full-widgetupdate(), about 22x fewer dirty pixels per frame at 60 FPS.drawPixmap, which ignores it.QPainterPathnot being rebuilt on resize, a pre-existing bug surfaced by the new tests.@pyqtSlotdecorators across 29 files, each signature resolved from the emittingpyqtSignaldeclaration.tests/paint/.Motivation
py-spy profiling on the target Raspberry Pi 5 showed
paintEventas the largest named Python frame while the UI sits idle (160 of 628 active samples). Those frames rebuilt QColor/QPen/QFont/QPainterPath objects and rescaled pixmaps that never change between frames. Smaller offenders in the same class (eventFilter, list-model SIP crossings, forcedrepaint()) were fixed in the same pass. No behavioural changes.