Skip to content

perf(index): optional uncompressed index - #118

Merged
amkram merged 1 commit into
mainfrom
perf/mmap-uncompressed-index
Jul 13, 2026
Merged

perf(index): optional uncompressed index#118
amkram merged 1 commit into
mainfrom
perf/mmap-uncompressed-index

Conversation

@amkram

@amkram amkram commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Adds an opt-in --index-uncompressed flag for faster (mmap) loading. Probably only useful for big panmans (sars 8M).

…ecompression pass)

Adds --index-uncompressed: stores the raw capnp payload after the param header
instead of ZSTD frames, so IndexReader mmaps the file and hands the bytes
straight to capnp (zero-copy) rather than decompressing the whole index into a
heap buffer on every load. The header's byte 26 records the format; old and
compressed indexes (flag 0) are unaffected, so this is fully backward compatible
and off by default.

A/B (page cache warm, byte-identical placement at -t1):
  TB place   -t8  2.13 -> 1.69s (-21%)   -t16 1.82 -> 1.41s (-23%)
  SARS place -t8  1.49 -> 1.39s (-7%)    -t16 1.31 -> 1.25s (-5%)
Bigger at higher thread counts: placement compute is fast there, so the
eliminated decompression pass is a larger fraction and page faults parallelize
across threads. Neutral at -t1.

Trade-off: larger on disk (TB 230->462MB, SARS 8->30MB) and cold first-load
reads more bytes, so it targets repeated placement against a resident index --
hence opt-in. Placement output is byte-identical at -t1; the -t8 last-digit
wobble is pre-existing parallel float-reduction non-determinism (the compressed
index alone gives different values run-to-run). unit + e2e + examples pass.
@amkram amkram changed the title perf(index): optional uncompressed index that is mmap'd on load (no decompression pass) perf(index): optional uncompressed index Jul 13, 2026
@amkram
amkram merged commit 62284b0 into main Jul 13, 2026
4 checks passed
@amkram
amkram deleted the perf/mmap-uncompressed-index branch July 13, 2026 21:17
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