Skip to content

perf: cache table page metadata during memo eviction - #1234

Open
MichaReiser wants to merge 3 commits into
salsa-rs:masterfrom
MichaReiser:optimize-memo-eviction-cursor
Open

perf: cache table page metadata during memo eviction#1234
MichaReiser wants to merge 3 commits into
salsa-rs:masterfrom
MichaReiser:optimize-memo-eviction-cursor

Conversation

@MichaReiser

@MichaReiser MichaReiser commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Cache the last resolved table page while evicting memo values, avoiding repeated page, vtable, memo-index, and type lookups for page-local victim streams. It slightly reduces the number of instructions on the eviction path for LRU, but it's a bigger impact for SIEVE where the eviction policy intentionally evicts items in their page order.

This keeps eviction policies storage-agnostic while preserving arbitrary ID ordering; the isolated sweep prototype improved by roughly 15%.

Benchmarks

Local benchmarks, because CodSpeed is bugged right now

Benchmark #1234 on LRU #1234 on SIEVE (#1226)
fast_path −0.2% +0.8%
fast_path_and_sweep +0.6% +0.4%
fill_and_evict +0.4% −0.1%
one_hit_wonders −0.1% −2.0%
phase_change −0.1% −0.9%
project_check_then_incremental +1.1% −0.1%
scan_resistance −1.4% −1.5%
Policy-specific instructions −1.39% −4.39%

@netlify

netlify Bot commented Jul 4, 2026

Copy link
Copy Markdown

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit db905fe
🔍 Latest deploy log https://app.netlify.com/projects/salsa-rs/deploys/6a4ff8fc9d9cc500080be39e

@codspeed-hq

codspeed-hq Bot commented Jul 5, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 74 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing MichaReiser:optimize-memo-eviction-cursor (db905fe) with master (25ed9d3)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@MichaReiser
MichaReiser force-pushed the optimize-memo-eviction-cursor branch 2 times, most recently from c3efbda to 5950f5a Compare July 5, 2026 13:26
Comment thread src/table.rs
use crate::zalsa::Zalsa;

#[test]
fn memo_cursor_caches_pages_with_ingredient_specific_memo_indices() {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm leaning towards deleting this test

@MichaReiser
MichaReiser marked this pull request as ready for review July 5, 2026 13:37
@MichaReiser
MichaReiser force-pushed the optimize-memo-eviction-cursor branch 2 times, most recently from f33e7a5 to 353707a Compare July 9, 2026 11:57
@MichaReiser
MichaReiser force-pushed the optimize-memo-eviction-cursor branch from 353707a to db905fe Compare July 9, 2026 19:39
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.

1 participant