Repository navigation
Qt: enable QTextLayout.setCacheEnabled(True) on bold wave layouts and share QtWaveBandCache - #2322
Merged
Merged
Conversation
…eBandCache across sidebar and tab bar
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
Cut waving sidebar and tab-bar paint time by enabling glyph-engine caching on Toad's only two
QTextLayoutallocations and eliminating per-tickFormatRangeallocations on the tab bar:QTextLayouts (src/toad/qt/name_wave.py):QtNameWaveDelegate.bold_titled(:94) andQtSessionTabBar.bold_line(:465) are the only twoQTextLayoutconstructions insrc/toad/qt/, and neither calledsetCacheEnabled(True)(unlikepyqt_reactive'sStyledTextRenderer.prepare).setCacheEnabled(True)beforebeginLayout()cuts 3,000 wavingQTextLayout.draw(..., inks)paints from 63.1 ms -> 36.1 ms / 61.8 ms -> 37.2 ms (1.7x faster, unprofiled warm alternating A/B), and cuts fullQtNameWaveDelegate.paint()by ~24%.QtWaveBandCache(BandCells)(src/toad/qt/name_wave.py):accent,accent_format, boundedinkscache,_init_wave_ink,_set_wave_accent, andcached_band_inksintoQtWaveBandCache(BandCells)inherited by bothQtNameWaveDelegateandQtSessionTabBar(deleting the duplicatedaccent_formatsetup and eliminating per-tickQTextLayout.FormatRangeallocation inQtSessionTabBar.paintEvent).Verification
tests/textual/test_name_wave_repaint.py,tests/model/test_android_perf_ux_arrivals.py): 37 passed in 0.67s (including assertions oncacheEnabled() is Truefor bothbold_titledandbold_line, sharedcached_band_inksreuse, andset_coloursinvalidation).tools/qt_inherit_ratchet.py: 0 / 0 / 0 / 0 / 0.tools/shadow_check.py: 0.tools/guarded_imports.py: 0.REL_IMPORTS=0.