Improve performance of sharded search when using RepoSets#14
Improve performance of sharded search when using RepoSets#14
Conversation
keegancsmith
left a comment
There was a problem hiding this comment.
LGTM so far. Mind sharing the benchmark output as is?
|
Current (before) benchmark output: Comparing the output against itself to get human-readable numbers via |
|
I've added a few sub-benchmarks that allow us to quickly see what impact a change has when (a) having no results (b) some results or (c) all (every file matches) results. Now, here's the impact of the optimizations in a161fb5: Even though it's |
|
FYI: benchstat works with a single file of benchmark results, no need to compare it with itself. |
|
Nice work! |
keegancsmith
left a comment
There was a problem hiding this comment.
nice work! This works as is, but got some inline feedback so it makes less assumptions about the sort of queries we pass in at the moment.
This commit does a couple of things to make the added behavior correct: 1. It reuses the simplified query produced by `selectRepoSet` which in turn reduces the work the shards have to do when evaluating the query 2. It only evaluates the `query.RepoSet` if it's part of a top-level `query.And`. The previous code was too naive when considering that a `query.RepoSet` can appear anywhere in a `query.Q`. See this comment for more details: #14 (comment) 3. It changes the const value that's returned in the simplified version so that `typeRepoSearcher`, which evaluates `query.TypeRepo` queries to a `query.RepoSet` works (the tests in `shards/eval_test.go` break without this.
- google.golang.org/grpc 1.75.0 -> 1.80.0 (addresses GHSA critical #11: authorization bypass via missing leading slash in :path). - go.opentelemetry.io/otel* 1.42.0/1.33.0 -> 1.43.0 (addresses sourcegraph#15 high: BSD kenv PATH hijack, and sourcegraph#14 medium: unbounded OTLP HTTP response body). Fixes Dependabot alerts 11, 14, 15 on sourcebot-dev/zoekt. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
No description provided.