Repository navigation
Conversation
cknitt
force-pushed
the
ocaml-rewatch-cmi-read-cache
branch
from
October 16, 2026 05:59
f8cc3c5 to
5c4deb7
Compare
Each module re-read the interfaces it uses, which for the large Stdlib ones is a sizable part of compiling a small module. Entries are checked against the file's identity, size and modification time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WZbCuRQ1Tn31bnKzLj5e72 Signed-off-by: Christoph Knittel <ck@cca.io>
cknitt
force-pushed
the
ocaml-rewatch-cmi-read-cache
branch
from
October 16, 2026 05:59
5c4deb7 to
77df19a
Compare
cknitt
marked this pull request as ready for review
October 16, 2026 05:59
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8874 +/- ##
==========================================
+ Coverage 81.02% 81.03% +0.01%
==========================================
Files 453 453
Lines 63030 63069 +39
==========================================
+ Hits 51070 51108 +38
- Misses 11960 11961 +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-8874 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With in-process compilation, OCaml rewatch compiles many modules on each worker domain, but every module read again each interface it uses. For the large Stdlib interfaces (
Stdlib_Array,Stdlib_String, …), reading and unmarshalling them is a sizable part of compiling a small module.Bs_cmi_loadcan now keep the interfaces it has read, per domain. Rewatch turns this on; the standalonebscdoesn't.Subst) temporarily marks the source types in place, so domains sharing one cached value crash. Within a domain, each copy restores its marks before the next request.fstaton the descriptor being read) are unchanged..cmifiles are rewritten in place, so on a file system with a coarse clock, a same-size rewrite within one tick would keep all of that metadata. Like Git with racily clean files, an interface modified in the last two seconds is never cached or reused.Outputs (JS and everything in
lib/) are byte-identical to master at 1 and 8 domains. Peak memory is about the same or lower.Clean builds on a Linux VM:
tests/tests(withoutstring_unicode_test)The synthetic project is closer to a real application, whose modules use the standard library throughout.
New test:
cmi_read_cacheinounit_compiler_request_tests.mlchecks that a just-written interface isn't kept, that an older one is, and that a same-size rewrite with a different modification time is read again.🤖 Generated with Claude Code