Repository navigation
Qt: share Gap/Divider document cache between block_row and header_document + inline cold Divider prep - #2321
Merged
Merged
Conversation
…s, and prepare cold Dividers inline
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.
Summary
Eliminate redundant
QTextDocumentlayout +setHtmlallocations when scrolling past message boundaries inQtHistoryWindow:src/toad/client/line_blocks.py,src/toad/qt/history.py):LineBlock.standalone_cache_key(row_key, index, shared_key)(default(row_key, index)) andSharedStandaloneBlock(LineBlock)inherited by bothDividerandGap(one declaration, zero duplicated overrides).HistoryRowDelegate.block_rowkeys leading blocks throughblocks[index].standalone_cache_key(key, index, lambda header: self.header_key(header, font, width)).Gap()across all messages at a given(font, width)now shares ONE cachedQTextDocumentinstead of allocating a freshQTextDocumentper crossed message, and every leadingDividermeasured byblock_rowhits the exact cachedQTextDocumentreused byQtStickyHeader.draw_pinned -> header_document(1setHtml/layout instead of 2).Dividerpreparation (src/toad/qt/history.py):HistoryRowDelegate.header_documentprepares a coldDivider(renders_inline=True) directly on the warmQtLineRendererwhen missing from_prepared(e.g. immediately after resize/theme switch) instead of waiting on aRenderProcessPoolround-trip.Verification
test_android_perf_ux_arrivals.py,test_history_preparation_runway.py,test_android_resync_lazy_load_catchup.py): 51 passed in 0.63s (including newtest_block_row_and_pinned_header_share_one_cached_document_and_prepare_inline).tools/qt_inherit_ratchet.py: 0 / 0 / 0 / 0 / 0.tools/shadow_check.py: 0.tools/guarded_imports.py: 0.REL_IMPORTS=0.