Skip to content

Add exclusive compiler phase tracing for OCaml rewatch - #8672

Closed
fhammerschmidt wants to merge 1 commit into
faster-rewatch-ocamlfrom
faster-rewatch-ocaml-followup
Closed

fhammerschmidt wants to merge 1 commit into
faster-rewatch-ocamlfrom
faster-rewatch-ocaml-followup

Conversation

@fhammerschmidt

Copy link
Copy Markdown
Member

Summary

  • Add an opt-in REWATCH_TYPECHECK_TRACE that records exclusive compiler phase timings, allocations, and request-level GC data across OCaml rewatch workers.
  • Add a trace analyzer and a benchmark runner for comparing traced and plain builds.
  • Document the measured type-checking, dependency-loading, and artifact-writing costs, including the limits of the measurements.

Stack

Depends on #8671. This PR adds the detailed compiler trace and benchmark analysis on top of that performance work.

Validation

  • make checkformat
  • make test

Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
@fhammerschmidt
fhammerschmidt added this pull request to stack #8668 September 25, 2026 09:36
@codecov

codecov Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.32271% with 77 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.69%. Comparing base (80eb959) to head (26ec8df).

Files with missing lines Patch % Lines
compiler/ext/compiler_phase_trace.ml 18.75% 39 Missing ⚠️
compiler/bsc/rescript_compiler_driver.ml 70.68% 17 Missing ⚠️
compiler/ml/cmi_format.ml 78.37% 8 Missing ⚠️
compiler/ml/env.ml 82.35% 6 Missing ⚠️
compiler/core/bs_cmi_load.ml 78.94% 4 Missing ⚠️
compiler/core/res_compmisc.ml 83.33% 2 Missing ⚠️
compiler/ml/typemod.ml 97.29% 1 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           faster-rewatch-ocaml    #8672      +/-   ##
========================================================
- Coverage                 78.73%   78.69%   -0.04%     
========================================================
  Files                       480      481       +1     
  Lines                     65110    65183      +73     
========================================================
+ Hits                      51264    51296      +32     
- Misses                    13846    13887      +41     
Files with missing lines Coverage Δ
compiler/core/js_implementation.ml 84.55% <100.00%> (+0.12%) ⬆️
compiler/ml/typemod.ml 73.88% <97.29%> (+0.16%) ⬆️
compiler/core/res_compmisc.ml 86.95% <83.33%> (+0.59%) ⬆️
compiler/core/bs_cmi_load.ml 78.94% <78.94%> (+1.16%) ⬆️
compiler/ml/env.ml 77.18% <82.35%> (+0.09%) ⬆️
compiler/ml/cmi_format.ml 79.31% <78.37%> (+1.31%) ⬆️
compiler/bsc/rescript_compiler_driver.ml 75.49% <70.68%> (+0.07%) ⬆️
compiler/ext/compiler_phase_trace.ml 18.75% <18.75%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fhammerschmidt

Copy link
Copy Markdown
Member Author

Superseded by consolidated PR #8680, which preserves this work as one commit in the combined review branch.

@fhammerschmidt
fhammerschmidt removed this pull request from stack #8668 September 26, 2026 17:55
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