Skip to content
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
mainfrom
christoph/usages-perf
Closed

WIP: Syntactic/Search-based usages perf#63971
kritzcreek wants to merge 2 commits into
mainfrom
christoph/usages-perf

Conversation

@kritzcreek

@kritzcreek kritzcreek commented Jul 22, 2024

Copy link
Copy Markdown
Contributor

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):

Takes a search for Model on spring-framework on my local machine from 5s (current main) to 140ms.

Test plan

Mostly existing tests

Christoph Hegemann 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
@cla-bot cla-bot Bot added the cla-signed label Jul 22, 2024
@github-actions github-actions Bot added team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform labels Jul 22, 2024
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>
@kritzcreek kritzcreek closed this Jul 29, 2024
@kritzcreek kritzcreek deleted the christoph/usages-perf branch July 29, 2024 02:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant