Repository navigation
Conversation
To see where a build spends its time, RESCRIPT_TRACE=<file> now makes the build write a Chrome trace event file when it exits, which Perfetto (ui.perfetto.dev) shows as a timeline: - The main track has a span per dependency graph (parse, compile, namespaces, format) and per scheduler step, and counters for the tasks that are ready and running. - Each worker slot has a track with a span per compiler request, named after its input file, with its allocated words and the garbage collections during it as arguments. Implementations get child spans for type checking and code generation, from a domain-local hook that Js_implementation calls once typing is done. Times are whole microseconds, so spans that share an end point nest exactly. A command that records nothing, such as a clean, leaves an earlier trace alone. Without the variable, the scheduler only checks a flag per step and the compiler calls an empty hook per implementation. Clean builds of tests/tests take the same time as before (0.28 s); with the trace on they take 0.305 s, mostly for writing its 1 MB file. A test in rewatch-ocaml/tests/run.sh checks the trace's spans and nesting and that traced builds write the same JavaScript. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QchYQ7itFLVLUmZ368okjH Signed-off-by: Christoph Knittel <ck@cca.io>
|
@codex review |
Changelog🚀 New Feature
Semantic Diff1 commit · Full page Write a build trace for Perfetto with RESCRIPT_TRACE67ea24a · cknitt + Claude · Nov 23, 2026, 20:08 UTC To see where a build spends its time, RESCRIPT_TRACE=<file> now makes the build write a Chrome trace event file when it exits, which Perfetto (ui.perfetto.dev) shows as a timeline: - The main track has a span per dependency graph (parse, compile, namespaces, format) and per scheduler step, and counters for the tasks that are ready and running. - Each worker slot has a track with a span per compiler request, named after its input file, with its allocated words and the garbage collections during it as arguments. Implementations get child spans for type checking and code generation, from a domain-local hook that Js_implementation calls once typing is done. Times are whole microseconds, so spans that share an end point nest exactly. A command that records nothing, such as a clean, leaves an earlier trace alone. Without the variable, the scheduler only checks a flag per step and the compiler calls an empty hook per implementation. Clean builds of tests/tests take the same time as before (0.28 s); with the trace on they take 0.305 s, mostly for writing its 1 MB file. A test in rewatch-ocaml/tests/run.sh checks the trace's spans and nesting and that traced builds write the same JavaScript. |
Codex Review Summary: ✅ CompletedThis 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: Didn't find any major issues. What shall we delve into next? 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". |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9402 +/- ##
==========================================
- Coverage 82.21% 82.21% -0.01%
==========================================
Files 460 461 +1
Lines 65552 65556 +4
==========================================
+ Hits 53892 53895 +3
- Misses 11660 11661 +1
🚀 New features to boost your workflow:
|
✅ Compiler benchmarksAllocated wordsIn total: 636,979,225 → 637,000,404 (±0.00%). Generated projects: 629,030,670 → 629,063,621 (+0.01%). None of the 265 benchmarks changed by 0.1% or more. InstructionsIn total: 9,221,381,560 → 9,221,393,321 (±0.00%). None of the 33 benchmarks changed by 0.1% or more. Output sizeIn total: 25,976,823 → 25,976,823 (±0.00%). None of the 13 benchmarks changed by 0.1% or more. Pull request 67ea24a compared with base 449d6e7 in this run. |
rescript
@rescript/belt
@rescript/darwin-arm64
@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-9402 |
To see where a build spends its time, set
RESCRIPT_TRACE=<file>. The build then writes a trace in the Chrome trace event format when it exits. Open it at ui.perfetto.dev to see a timeline:parse,compile,namespaces,format) and per scheduler step, plus counters for the tasks that are ready and running.Gaps on the worker tracks while the ready counter is above zero are time lost to scheduling. Long type-checking spans show which modules hold up their dependents.
The typing split comes from a small domain-local hook (
Compile_phase_hookincompiler/driver) thatJs_implementationcalls once typing is done. Worker slots are used instead of domain ids, because each dependency graph starts a new worker pool.Cost: without the variable, the scheduler checks a flag per step and the compiler calls an empty hook per implementation. Clean builds of
tests/tests(690 modules, 10 alternating runs) take 0.28 s with and without this change. With the trace on they take 0.305 s, mostly to write the 1 MB trace file.New test:
rewatch-ocaml/tests/run.shbuilds a two-module project with and without the trace. It checks that the JavaScript is the same, and that the trace has the request spans, their typing and code-generation children, the graph span and the counters.The format is meant for people and may change. Existing
REWATCH_*variables will getRESCRIPT_*names in a separate PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01QchYQ7itFLVLUmZ368okjH