Repository navigation
virtual rows: bound per-key row metrics and reschedule multi-slice measurement - #76
Merged
Merged
Conversation
…multi-slice measurement
1. Consolidate RowDocumentDelegate's three parallel per-width dicts
(_size_hints, _extents, _cached_widths) into one LRU-bounded OrderedDict
of per-key width->RowMetrics (_metrics, bounded by MAX_PREPARED_ROWS).
- Evicting an old key from _prepared now also drops its kept metrics and
documents instead of leaking them forever.
- Keys measured directly via measured_height without entering _prepared
(e.g. pinned sub-block measurements) stay LRU-bounded to MAX_PREPARED_ROWS.
- Expose measured_size_for(key, width) and measured_count() instead of
probing _size_hints directly.
2. Fix _measure_slice() stopping mid-thread when unmeasured rows span multiple
8ms slices: `if measured: view.rows_changed()` previously skipped
`elif self._unmeasured: self._measure_timer.start()`, and because estimated
rows already hold a kept_row entry, sizeHint() never re-armed the timer.
Change `elif self._unmeasured:` to `if self._unmeasured:` so multi-slice
measurement always drains to completion.
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.
Consolidates RowDocumentDelegate._size_hints, _extents, and _cached_widths into one LRU-bounded _metrics OrderedDict (evicting metrics/documents with _prepared and bounding direct measured_height keys), and fixes _measure_slice() skipping _measure_timer.start() when remaining unmeasured rows span multiple 8ms slices.