Repository navigation
perf(resolution): a full index detects frameworks once, and remembers which paths are tests - #3151
Merged
Merged
Conversation
… which paths are tests Every resolver worker detected the project's frameworks for itself as it started, and a detector may read every source file: Spring's reads each `.java` until it finds an annotation, so in a Java project without Spring, six workers each read the whole project. A full index has just detected them on the same files in the main thread, so it now hands the workers the names. A sync, where the main thread's answer may be older, leaves them to detect as before. isTestPath runs seven patterns over a path, and resolving asks about the same paths for every reference and candidate. It now remembers the answer, up to 100,000 paths. elasticsearch subset, 1,710 files: self time in detection 4.4 s to 2.3 s, in isTestPath 1.4 s to under 0.1 s, out of about 50 s of CPU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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 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.
Every resolver worker detected the project's frameworks for itself as it
started, and a detector may read every source file: Spring's reads each
.javauntil it finds an annotation, so in a Java project without Spring, six workers
each read the whole project. A full index has just detected them on the same
files in the main thread, so it now hands the workers the names. A sync, where
the main thread's answer may be older, leaves them to detect as before.
isTestPath runs seven patterns over a path, and resolving asks about the same
paths for every reference and candidate. It now remembers the answer, up to
100,000 paths.
elasticsearch subset, 1,710 files: self time in detection 4.4 s to 2.3 s, in
isTestPath 1.4 s to under 0.1 s, out of about 50 s of CPU.
Validation
Adds
resolver-shared-frameworks.test.ts: the names give what detection gives, in the same order. A sync passes nothing, so workers detect as before there. Framework resolvers keep no state of their own (detectonly reads, and their memos are per context).scripts/dump-graph.mjsdumps byte-identical to main on 14 repos: tokio, gin, flask, jsoup, excalidraw, serilog, ripgrep, taxonomy, and subsets of django, rocksdb, elasticsearch (two), rails and laravel. That's with all of this stack's commits in, on one build.CODEGRAPH_KERNEL_EXPECT=1, 4 workers, Vitest 4): 848 files passed, 6 skipped; 10,515 tests passed, 2 expected fails, 87 skipped, 0 failed.Part of the work to bring main back to 1.6.2's speed. Independent of the other PRs of it: it compiles alone on main.
🤖 Generated with Claude Code