Repository navigation
tantivy: copy bundle ranges by slice, not byte by byte - #434
Merged
Merged
Conversation
A warm 7-day errors list still spent ~3 s in the tantivy fan-out after the index count fell 273 -> 60: tantivy opens a fast-field column by reading it whole, and each bundle read assembled those hundreds of MB through a per-byte iterator with a vector per block. Covered by a property test over block edges.
Monoscope production impact · Coverage unknownProject Evidence window (UTC): 2026-10-18 20:40:58.04257947 UTC → 2026-10-25 20:40:58.04257947 UTC Coverage: Open Monoscope for evidence and coverage details. |
|
Review: LGTM.
No security concerns. |
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.
After #432 cut the indexes a warm 7-day errors list (6297304f) searches from 273 to 60, the query still spent ~3 s in the tantivy fan-out. It did not scale with hits (800 vs 200 hits both ~3 s; a window narrowed to today's small indexes: 32 ms) nor with the window range filter (day-aligned window still 2.4 s): it scales with the size of the day indexes in the window.
tantivy opens a fast-field column by reading it whole, and
BundleDirectory::readassembled every range — hundreds of MB per day index, per query — throughflat_map(|b| b.iter().copied().collect_vec())with a vector per 64 KB block. It now copies each block's span withextend_from_slice.Test: proptest
a_bundle_range_reads_back_exactly(arbitrary ranges over block edges, cold and cached); red when the start offset is ignored.Local signoff:
make ci-signofffmt/test/pg-smoke/e2e/clippy all pass (attested).🤖 Generated with Claude Code