Repository navigation
Perf(qt): LRU-cache QtStickyHeader docs/pixmaps and skip occluded opaque strips in scrollContentsBy - #2336
Merged
Conversation
…que strips in scrollContentsBy
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.
Numbers
#comms412x915FrameProbe5s fling:QtStickyHeader.draw_pinnedstack share1.6% -> 0.3%(5.3x reduction),LayoutRequest/QtHistoryWindow44x -> 0x,worst_stall_ms9.0 ms -> 7.7 ms.412x915):origin/main:59.707, 61.957, 60.239, 58.710 ms(median59.973 ms, 239QTextDocumentbuilds)30.391, 34.248, 34.601, 35.177 ms(median34.425 ms, 20QTextDocumentbuilds — 1.74x wall-clock speedup, 11.95x fewer document layouts)Mechanism
QtStickyHeaderbounded LRUs + no-op geometry guard (src/toad/qt/history.py):draw_pinned()previously replacedself.laid_outwith only the current header and wipedself._pixmap_cache = Noneon every message-boundary crossing, rebuildingQTextDocument+setHtml+ layout + rasterQImageon every switch and callingresize()/move()/raise_()unconditionally (44LayoutRequest/QtHistoryWindowevents in 5s).QTextDocuments (OrderedDict, cap 32) and rasterizedQImages (OrderedDict, cap 16) whilelayout_contextis unchanged, and skips no-opresize/move/raise_.VirtualRowCanvas.scrollContentsByopaque-cover exclusion (src/toad/qt/virtual_scroll.py):floating_covers()into(covers, opaque)usingWA_OpaquePaintEventand subtractopaquerects fromviewport.update(dirty)(skippingviewport.updatealtogether when empty) so occluded pixels under opaque floating siblings likeQtStickyHeaderare never invalidated on scroll.Verification
tests/model/test_android_perf_ux_arrivals.py: 42/42 passed in0.70s(including new test coveringQtStickyHeaderLRU hits, no-opresize/moveguards, andVirtualRowCanvas.scrollContentsByopaque vs translucent cover clipping).REL_IMPORTS=0,qt_inherit_ratchet0/0/0/0/0,shadow_check0,guarded_imports0.