Repository navigation
index: reuse resolved lines for chunk matches - #1202
Merged
keegancsmith merged 2 commits intoOct 29, 2026
Merged
Conversation
Signed-off-by: Perfloop Agent <[email protected]> Signed-off-by: Tomás Senart <[email protected]>
Signed-off-by: Perfloop Agent <[email protected]> Signed-off-by: Tomás Senart <[email protected]>
Contributor
|
Hi @keegancsmith :) |
keegancsmith
self-requested a review
October 29, 2026 15:36
Member
GitHub isn't letting me push. I'll just land and fast follow with some minor changes. |
Member
|
@tsenart 👋 |
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.
Chunk-mode Search used to resolve content matches to lines while grouping candidates, building ranges, and scoring chunks. This change carries each resolved range through those steps so the call avoids repeated line lookups.
A monotone cursor reuses the current line and binary-searches from there after a gap. The emitted ranges supply start lines to scoring, and chunks use contiguous spans of the original candidates. The existing end-line clamp, unsorted-candidate fallback, UTF-8 columns, score ties, debug scores, BestLineMatch, and symbol associations are preserved. No public API or shard format changes.
The index package tests, focused scoring and ranking end-to-end tests, and all-package Go build passed. The full repository test suite remains for target CI.
ns/opns/opns/opns/opThe source-file measurements time repeated
Searcher.Searchcalls withChunkMatchesenabled on a one-document shard built from checked-in Go files; shard construction and initial validation are outside the timer, and the same harness and source bytes are used on both versions. Dense input is the case-sensitive literalfuncinsearch/shards.go(85 matches across 1,679 newline offsets); the sparse guard is the singlereturn &curnear EOF inquery/parse.go(652 newline offsets). The context guard uses eight context lines. The existing syntheticBenchmarkScoreChunkMatchesinindex/index_test.gois also included as a guard, not as the consumer estimate. The auxiliary Go benchmark harness used for these measurements is not included in the PR.ns/opis elapsed time per Search call, not CPU time. Production traffic mix, input prevalence, and deployment-level savings remain unmeasured.Generated by Perfloop. Human sponsor: Tomás Senart.