Repository navigation
Find live toplevel bindings in Js_shake with a worklist - #8773
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ffd5c80988
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## perf-external-shadow #8773 +/- ##
========================================================
- Coverage 80.66% 80.66% -0.01%
========================================================
Files 463 463
Lines 62758 62755 -3
========================================================
- Hits 50623 50619 -4
- Misses 12135 12136 +1
🚀 New features to boost your workflow:
|
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
Js_shake repeated a full pass over the module, recomputing every initializer's free variables, until no new binding became live. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
A backward chain to an export, helpers kept by statements with side effects, and a dead chain that is removed (same JS as before the change). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Stacked on #8772.
Js_shakedecides which toplevel bindings of a module to keep. It repeated a full pass over all toplevel statements, recomputing the free variables of every initializer (the code had aTODO: add hashtbl for a cache), until no new binding became live. A dependency chain that runs backwards through the module needs one pass per link, which is quadratic.The live set is the least set that contains the exports, the free variables of statements with side effects and the bindings whose initializer has side effects, and that contains the free variables of the initializer of every live binding.
live_identsnow computes the free variables of each initializer once and follows them with a worklist, which gives that same set in linear time.Measurements
Same method as #8769, compared with the previous PR in the stack. All 574 files of
tests/tests/src(not only the benchmark corpus) compile to byte-identical JS and diagnostics.Modules whose live set settled in a single pass now pay a little for the dependency table (e.g. +1.9% allocation on a file with 1800 string literals), which is why real files come out about even.
🤖 Generated with Claude Code