Repository navigation
perf(virtual-rows): add El::virtual_rows_append_only() so growing lists read only appended keys - #1802
Merged
Conversation
…ts read only appended keys
Hona
force-pushed
the
fix/203-virtual-rows-append-only
branch
from
November 24, 2026 00:44
77a3bc9 to
501fa1a
Compare
This was referenced Nov 24, 2026
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.
Fixes #203
Root cause
crates/rune/src/runtime/commit/measure.rs, anyEl::virtual_rowscount change treated the whole list as changed, callingRowSource::keyfor every row and rebuildingVirtualList's key table and prefix sums incrates/rune/src/el/virtual_list.rs.El::virtual_rows_versionpromises that count changes are always detected without a bump, so growing append-only lists still paid O(rows) on every append.What changed
El::virtual_rows_append_only()(crates/rune/src/el/virtual_rows.rs,crates/rune/src/el/rare.rs,crates/rune/src/runtime/commit/memo_reuse.rs) so a list can promise that a longer count (with unchangedvirtual_rows_version, if set) keeps existing keys in order and only appends new rows at the end.VirtualList::append_keysandVirtualList::try_append_rows(crates/rune/src/el/virtual_list.rs, wired incrates/rune/src/runtime/commit/measure.rs) to insert only new keys intoPlaces, extendmeasured/born/row_heightsand fresh prefixsumsin O(new rows), keepWindow::same == falseso memo regions update, and fall back toset_keyson duplicate new keys, shrinks, orvirtual_rows_versionbumps.crates/rune/src/tooling/perf_warn.rs,crates/rune/src/runtime/commit/measure.rs,crates/rune/src/runtime/commit/remount.rs):populate_virtual_children/remount_virtuals, warning once per list viaperf_warn.Benchmark & verification
Headless
Runtimeappending 1 row/frame to a 100,000-row list (50 frames/run, 5 paired alternating runs under--profile perf, all outliers kept; excludes GPU upload and presentation):virtual_rows)virtual_rows_append_only()crates/rune/src/el/virtual_rows_append_tests.rs,crates/rune/src/el/virtual_list.rs, andcrates/rune/tests/integration/virtual_rows_append.rs(append_only_reads_only_new_keys_while_default_reads_allfailed with 10,001 calls before the fix and passes after).cargo test -p rune -p rune-mermaid -p rune-kit --features rune-kit/markdown,rune-kit/mermaid el::virtual_(43 passed, 0 failed)cargo test -p rune -p rune-mermaid -p rune-kit --features rune-kit/markdown,rune-kit/mermaid virtual_rows_append(1 passed, 0 failed)cargo test -p rune --profile perf --test integration virtual_rows_append_only_public_api_counts(1 passed)cargo test -p rune --profile perf --test integration virtual_rows_append_time -- --ignored --nocapturescripts/file-size.sh(0 errors, 0 new warnings)Runtimeonly; code is platform-independent with no target-specificcfgblocks).