You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Index size is the headline: the on-disk index is ~4.5× the size of the source it indexes, against a target of under one-third. This reproduces on a pristine index, so it is inherent to the format, not accumulated cruft.
Severity
🟠 Performance / scalability. At ~4.5× source the index does not scale to large repos within the stated budget, and the oversized postings file directly inflates query latency (it must be mmap'd/scanned). Query latency is already at/over the 50 ms target on a small 666-file repo, so larger repos will exceed it.
Evidence
Per-file breakdown of the index for this repo (~/Library/Caches/skim/search/<hash>/, or a fresh SKIM_CACHE_DIR):
Shared with #355 (lexical relevance): the lexical index is a byte-bigram index. There are ~65k possible bigrams and common code bigrams (re, in, er, …) occur in nearly every file at many positions, so their posting lists are enormous. Storing per-occurrence position data for these high-frequency bigrams is what bloats index.skpost to 74 MB. The same coarseness that makes bigrams non-selective for ranking makes their posting lists huge.
→ Whatever n-gram-width / tokenization change is chosen for the relevance issue (#355) will change this size profile substantially, so the two should be designed together. But there are also size wins available independent of relevance (see below).
Design directions for a fix (needs design + measurement)
Address jointly with the lexical-relevance fix. Trigrams/token-aware grams have far fewer, far shorter high-frequency posting lists.
Compress postings: delta + varint (or PForDelta/Roaring) encoding of doc-id and position lists; this is standard for inverted indexes and typically yields multiple-× reductions.
Reconsider storing per-occurrence positions for high-frequency grams (or cap/skip positions above a frequency threshold) — positions are the bulk of the bytes.
Prune the lowest-IDF grams entirely (they carry no ranking signal but dominate size).
Summary
The search index misses two of the four #174 performance targets on a real repo:
temporal53 ms,jaccard coupling63 ms)Index size is the headline: the on-disk index is ~4.5× the size of the source it indexes, against a target of under one-third. This reproduces on a pristine index, so it is inherent to the format, not accumulated cruft.
Severity
🟠 Performance / scalability. At ~4.5× source the index does not scale to large repos within the stated budget, and the oversized postings file directly inflates query latency (it must be mmap'd/scanned). Query latency is already at/over the 50 ms target on a small 666-file repo, so larger repos will exceed it.
Evidence
Per-file breakdown of the index for this repo (
~/Library/Caches/skim/search/<hash>/, or a freshSKIM_CACHE_DIR):skim search --statsreportstotal n-grams : 9577→index.skpostis ~74 MB / 9577 ≈ 7.7 KB per n-gram posting list.Query latency (internal
duration_msfrom--json, 666-file index):temporal→ 53 msCompositeWeights6→ 42 msjaccard coupling→ 63 msRoot cause
Shared with #355 (lexical relevance): the lexical index is a byte-bigram index. There are ~65k possible bigrams and common code bigrams (
re,in,er, …) occur in nearly every file at many positions, so their posting lists are enormous. Storing per-occurrence position data for these high-frequency bigrams is what bloatsindex.skpostto 74 MB. The same coarseness that makes bigrams non-selective for ranking makes their posting lists huge.→ Whatever n-gram-width / tokenization change is chosen for the relevance issue (#355) will change this size profile substantially, so the two should be designed together. But there are also size wins available independent of relevance (see below).
Design directions for a fix (needs design + measurement)
Acceptance criteria
~2.2×index-size ratio bound inreader_tests.rsper bench docs — that bound is far looser than the North Star: 3-Layer Code Search System (skim search) #174 target and should be reconciled).Related
crates/rskim-searchbench/reader tests (~2.2×)