Repository navigation
A row's kept size leaves the sizes kept under its key when it leaves its row - #74
Merged
Merged
Conversation
…its row RowDocumentDelegate keeps each row's measured size twice: in the row's slot (`_row_sizes`) and under its preparation key (`_row_size_keys`, which `_moves_rows` reads when a row's formatting arrives). rows_removed, rows_data_changed and a new measure of the same row cleared or replaced the slot and left the size under the key, so a list that pages rows in and out held every size it had ever measured. After a finger scroll back through a long Toad thread (255 pages through a 240-row window): 171,302 RowSize, each with its QFont, and about 389,000 tuples, for 4,436 rows: 79% of the 924,563 objects Python's collector walked. A full collection took 396 ms and four of them stopped the GUI thread for 158-321 ms during the scroll, on a desktop. With this: 234,903 objects, a full collection 74 ms. `_unkeep` takes a size out from under its key; the three places a size leaves its slot call it. Tests: tests/test_virtual_rows.py, 12 passed (new: rows changed and measured again 50 times, and removed, keep one size each under their keys). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016gZLdx92gKjvnNKianjAXG
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.
RowDocumentDelegatekept every row size it ever measured under its preparation key: removing a row, changing it or measuring it again cleared the row's slot and not the per-key list.After a finger scroll back through a long Toad thread: 171,302
RowSize(each with aQFont) for 4,436 rows, 79% of the 924,563 objects the collector walked; a full collection 396 ms, four of them stopping the GUI thread for 158-321 ms. With this: 234,903 objects, 74 ms.Tests:
tests/test_virtual_rows.py, 12 passed (one new).🤖 Generated with Claude Code
https://claude.ai/code/session_016gZLdx92gKjvnNKianjAXG