This repository was archived by the owner on Sep 30, 2024. It is now read-only.
WIP: Syntactic/Search-based usages perf#63971
Closed
kritzcreek wants to merge 2 commits into
Closed
Conversation
added 2 commits
July 22, 2024 03:53
use unified diff format and 0 context lines to allow translation by just using hunk headers only request hunks per file once, and sync follow-up requests for the same file don't bother LRU caching the full hunk contents, just store 4 int32's per hunk replace linear search through sorted hunks with binary search
kritzcreek
referenced
this pull request
Jul 25, 2024
Closes https://linear.app/sourcegraph/issue/GRAPH-765/use-surroundingcontent-returned-from-the-search-client The primary reason for doing this is to avoid sending a bunch of extra calls for file contents to gitserver, which dominate the profile/trace after implementing the remaining opts from https://github.com/sourcegraph/sourcegraph/pull/63971 Also limits the API to only return the line containing the match for now as discussed with Camden. We might need to bring back the `lineGetter` for precise usages, but it should be easy enough to revive at that point /cc @varungandhi-src ## Test plan Updated unit tests, some manual testing in the API console
kritzcreek
pushed a commit
that referenced
this pull request
Jul 29, 2024
#64078) Closes https://linear.app/sourcegraph/issue/GRAPH-771/chunk-syntactic-usage-tasks-and-use-batch-apis-to-handle-chunks This is the last step for properly implementing #63971. We split the `candidateFiles` search produces into chunks and process these in parallel using the new batch api on `MappedIndex`. ## Test plan Existing tests continue passing --------- Co-authored-by: Varun Gandhi <varun.gandhi@sourcegraph.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
A pile of changes for low/mid hanging fruits for syntactic usages perf. This should give us a reasonable estimate of the performance/load we can expect. Known to be fast. Correctness might've suffered?
The individual changes (I'll break these up into individual PRs over time):
MappedIndexto tie the new batch APIs together and prefetch diffs (codeintel: Adds a batch api for fetching multiple documents to MappedIndex #64073)candidateFiles returned from search (codeintel: Speed up syntactic and search-based usages using batch APIs #64078)Takes a search for
Modelon spring-framework on my local machine from 5s (current main) to 140ms.Test plan
Mostly existing tests