Repository navigation
Qt scroll: restore QtHistoryWindow.floating_covers, fast-path single opaque cover, cache RowPictures weight, guard QTimer teardown - #2338
Merged
Conversation
…opaque cover, cache RowPictures weight, guard QTimer teardown
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 first
VirtualRowCanvas.scrollContentsBy+QtHistoryWindow.floating_covers, 19 children, 2,000 scroll steps,PARITY=True):[50.95, 74.41, 47.37, 75.82]-> median62.68 ms[46.38, 34.92, 29.03, 57.19]-> median40.65 ms(1.54xspeedup)#comms412x915FrameProbefling:floating_covers:2.4% -> 0.3%(8.0xreduction)RowPictures.keep:2.9% -> 0.7%(4.1xreduction)269.1 -> 205.1(-24%),viewportEvent207+169 -> 147+140(-29%),UpdateRequest/QtToadApp938 ms -> 811 ms,paints699 ms -> 585 ms,>=16 msstalls0What changed
QtHistoryWindow.floating_covers(src/toad/qt/history.py:1673):#2336renamedVirtualRowCanvas.scrollContentsBy's lookup fromfloating_over()tofloating_covers(), bypassingQtHistoryWindow.floating_over()and regressing every scroll tick toself.children()across ~18 C++ childQObjects (2.4%of all CPU in liveFrameProbe).QtHistoryWindow.floating_over()withfloating_covers(), inspecting only(self.sticky_header, self.jump_bar)and returning(covers, opaque).VirtualRowCanvas.floating_covers,uncovered, andscrollContentsBy(src/toad/qt/virtual_scroll.py:1202-1260):geo = child.geometry()andtop_left = area.topLeft()once per visible child instead of repeated C++ calls.sorted()allocation inuncovered()whenlen(covers) <= 1.scrollContentsBy(): sinceclearandcoverare disjoint subsets ofvp_rect,area(clear) + area(opaque[0]) == area(vp_rect)holds iffvp_rect \ clear == opaque[0], skipping all 3QRegionallocations/subtractions on steady-state sticky-header scroll ticks while still updating the opposite band for mid-viewport opaque covers.RowPicturescached tile weight +popitem(last=False)(src/toad/qt/history.py:766-780):weightinRowPictures.rows4-tuple(look, document, picture, weight)and switched LRU eviction fromself.drop(next(iter(self.rows)))(which also calledpicture.size()again on every eviction) toself.rows.popitem(last=False).QtToadApp._schedule_animationteardown guard (src/toad/qt/window.py:13, 2004):self._animation_timerwithshiboken6.isValid(...), fixing a realRuntimeError: Internal C++ object (QTimer) already deletedraised during app/widget teardown.tests/model/test_android_perf_ux_arrivals.py:2706-2740):QtHistoryWindow.floating_coversassertsself.children()is never called and splits opaque covers.RowPicturesverifiespopitem(last=False)FIFO eviction and exact byte accounting.Verification
pytest tests/model/test_android_perf_ux_arrivals.py: 42 passed in 0.75stools/qt_inherit_ratchet.py:0/0/0/0/0tools/shadow_check.py:0tools/guarded_imports.py:0REL_IMPORTS=0