Skip to content

perf(resolution): look for a JS binding only where a mention of the name could be one - #3149

Merged
colbymchenry merged 1 commit into
mainfrom
claude/spd-js-sites
Oct 31, 2026
Merged

colbymchenry merged 1 commit into
mainfrom
claude/spd-js-sites

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

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.

Validation

Nothing changes but the time, so the proof is the graph.

  • Graphs: scripts/dump-graph.mjs dumps 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.
  • Full suite on the stack tip 38c97bd0, which holds all nine commits of this work on a0174ce (kernel built from that tree, CODEGRAPH_KERNEL_EXPECT=1, 4 workers, Vitest 4): 848 files passed, 6 skipped; 10,515 tests passed, 2 expected fails, 87 skipped, 0 failed.
  • Numbers are interleaved on a machine other agents were using, so read the ratios. REG's quiet-machine run gives the final ones.

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

…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>
@colbymchenry
colbymchenry merged commit fc7dd0d into main Oct 31, 2026
@colbymchenry
colbymchenry deleted the claude/spd-js-sites branch October 31, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant