Repository navigation
perf(resolution): look for a JS binding only where a mention of the name could be one - #3149
Merged
Merged
Conversation
…ame could be one jsCodeBindsName and bindsAtSites asked whether a function or a file binds a name by running large patterns, or walking back to a parenthesis, for every mention. Nearly all mentions of a name a function doesn't bind are calls and member reads. jsNameSites reads the characters around each mention first: a declaration's name has a blank before it, a parameter's has `?`, `:`, `=`, `,` or `)` after it. When none could be, neither pattern is built. pythonLineBindings likewise skips its import pattern on a statement that doesn't hold the word. excalidraw: CPU 29.1 s to 26.6 s. django subset: 20.7 s to 19.6 s. Interleaved, three rounds. 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.
jsCodeBindsName and bindsAtSites asked whether a function or a file binds a name
by running large patterns, or walking back to a parenthesis, for every mention.
Nearly all mentions of a name a function doesn't bind are calls and member reads.
jsNameSites reads the characters around each mention first: a declaration's name
has a blank before it, a parameter's has
?,:,=,,or)after it. Whennone could be, neither pattern is built.
pythonLineBindings likewise skips its import pattern on a statement that doesn't
hold the word.
excalidraw: CPU 29.1 s to 26.6 s. django subset: 20.7 s to 19.6 s. Interleaved,
three rounds.
Validation
Nothing changes but the time, so the proof is the graph.
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