Repository navigation
Developer playground: compare Lambda before and after optimization - #8636
fhammerschmidt wants to merge 3 commits into
Conversation
| required | ||
|
|
||
| let compile (output_prefix : string) export_idents hoisted (lam : Lambda.t) = | ||
| let compile ?on_optimized_lambda (output_prefix : string) export_idents hoisted |
There was a problem hiding this comment.
Seems I cannot extract optimized lambda for the playground without this addition
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8636 +/- ##
==========================================
- Coverage 80.51% 80.51% -0.01%
==========================================
Files 447 447
Lines 61060 61062 +2
==========================================
+ Hits 49162 49163 +1
- Misses 11898 11899 +1
🚀 New features to boost your workflow:
|
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-8636 |
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. |
|
@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". |
|
Review notes (no wrong-diff bugs found; mostly performance): Performance
Behaviour Nit Items 1, 2 and 6 share one fix: keep the view and its diff results alive across compiles, keyed on the input text, and render collapsed sections only when opened. 🤖 Generated with Claude Code |
… including diffs Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Keep the Lambda view mounted, cache its rendered comparison by input text, and render collapsed context only when expanded. Preserve expansion for unchanged regions across edits. Count shared edges once in the line budget, prioritize atoms in token alignment, and admit whole changed blocks before charging the shared token budget. Cover the algorithm and rendering regressions, and document the API v9 capture boundary. Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
443ae37 to
e33b965
Compare
Add Before, After, and Diff views to the developer playground's Lambda tab. Playground API v9 exposes
lambda_optimizedfromcompileWithDebugafter the whole-term Lambda passes and before export grouping and JavaScript lowering. Regular compilation does not capture debug output; older compiler bundles retain an availability notice.Keep the Lambda view mounted and cache the latest rendered comparison by its printed inputs, including line alignment, inline highlights, and context sections. Switching tabs or recompiling identical dumps reuses the diff DOM. Collapsed context renders only when expanded, and unchanged regions retain their expansion state across edits.
Strip shared edges before the line comparison, count those edges once in the output budget, and omit empty visible sections. Token alignment prioritizes shared atoms over punctuation. Preflight all candidate work in a changed block and skip the whole block when it cannot fit the remaining global budget, preserving capacity for later small changes. Actual work on unchosen candidates remains counted so the overall bound still holds.
Validation: