Skip to content

Pin MatrixCache at the revision where an invalidation leaves the disk order by key - #3109

Merged
matrixarkai merged 1 commit into
mainfrom
perf/matrixcache-pin-takes-the-disk-order-fix
Nov 14, 2026
Merged

matrixarkai merged 1 commit into
mainfrom
perf/matrixcache-pin-takes-the-disk-order-fix

Conversation

@matrixarkai

Copy link
Copy Markdown
Owner

Moves the MatrixCache pin from 30a4fb9 to 5db2696 (MatrixCache main), which carries matrixarkai/matrixcache#454: an invalidation removes each named key from the SSD order by key instead of walking every entry in the order to find them. Before that change one invalidation cost as much as the number of entries on disk (about 12x slower at 16,000 entries than at 1,000 in a debug-build micro-measurement; flat after).

Only crates/temporalstore-rust/Cargo.toml (the rev) and Cargo.lock (its one source line) change. The new revision also carries eight documentation and presence-query commits that followed the old pin; none changes a call this crate makes.

Checked: cargo +1.89.0 check --locked -p temporalstore-rust --all-targets is clean (the CI toolchain).

Not measured here: the effect on the shared-store harness. In an earlier profile that call was 75.9M of 1,179M instructions (6.4%) over 6,400 invalidations, but that corpus holds few keys, so the scaling benefit is the micro-measurement above, not a harness figure.

Known gate: cargo test (round, container and key-inversion cost guards, hard gate) fails on what_the_entry_restating_its_key_costs_the_shipped_container on main as well as on this branch; this change does not touch container bytes.

🤖 Generated with Claude Code

… order by key

The pin was `30a4fb9`. MatrixCache main now has the change that stops an invalidation from walking
every entry in the SSD order to find the keys it named (MatrixCache #454), so one invalidation no longer
costs as much as the number of entries on disk.

The new revision also carries eight documentation and presence-query commits after the old pin; none
changes a call this crate makes, and `cargo check --locked --all-targets` is clean on the 1.89.0
toolchain the CI job uses. Cargo.lock changes in the one source line.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@matrixarkai
matrixarkai merged commit 5b265a1 into main Nov 14, 2026
6 of 7 checks passed
@matrixarkai
matrixarkai deleted the perf/matrixcache-pin-takes-the-disk-order-fix branch November 14, 2026 18:14
@matrixarkai

Copy link
Copy Markdown
Owner Author

Follow-up measurement, since the description said the harness effect was not measured.

scale_harness --compare-shared-store (3 nodes, door in journal mode), callgrind total instructions, with #3107 and #3108 in both builds and only this pin differing:

writes pin 30a4fb9 pin 5db2696 change
300 837.4M 828.9M -1.0%
1,200 1,179.0M 1,174.6M -0.4%

So the disk-order fix is worth about 4-9M instructions in this harness, whose corpus holds few keys. The per-write marginal is not lower (about 384K per write after against about 380K before); that is within what the eight other MatrixCache commits that came with the pin can add, so this is not a per-write win. The benefit of matrixarkai/matrixcache#454 is at large disk-tier sizes, where the old walk grew with the number of entries (about 12x slower at 16,000 entries than at 1,000 in a debug-build micro-measurement).

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants