Repository navigation
Stop measuring lambda size once the inlining limit is reached - #8771
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: 43dcace26a
ℹ️ 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 @@
## quick-perf-fixes #8771 +/- ##
===================================================
Coverage ? 80.66%
===================================================
Files ? 463
Lines ? 62758
Branches ? 0
===================================================
Hits ? 50623
Misses ? 12135
Partials ? 0
🚀 New features to boost your workflow:
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a620591952
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! 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: |
Callers only compare the size with small thresholds, but it was computed for the whole body at every call site of a known function. 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>
Unit tests for size_upto at the inlining limits, and a fixture with calls on both sides of the thresholds (its JS is the same as before the change). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Large constant lists or records were still walked completely before the limit was checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Stacked on #8769.
Lam_analysis.sizeestimates a lambda's size for inlining decisions. Its callers only compare the result with small thresholds (5, 7 or 10), but it walked the whole lambda every time, including at every call site of a known function (Lam_pass_remove_alias, which runs several times per module). It also installed an exception handler at every level of the recursion.sizeis replaced bysize_upto ~limit, which stops counting once the running total reacheslimitand returns the size if it is belowlimit,limitotherwise. Each caller passes the largest threshold it compares with, so every comparison has the same result as before. Constructs that madesizereturn 1000 (loops, switches,try, ...) still count as 1000, which is above any limit. Constants count their leaves against the same limit, so a large constant list or record in a function body is not walked completely either.Measurements
Same method as #8769: allocated words (
OCAMLRUNPARAM=v=0x400, deterministic) and CPU time as the minimum of 7 interleaved runs, compared with the previous PR in the stack. Every benchmark file compiles to byte-identical JS and diagnostics.The small allocation increase is the counter's closure.
🤖 Generated with Claude Code