Repository navigation
Add a debug option to cheerpjInit, and document how to warm up a library VM - #52
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 46 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
This PR adds a debug option to cheerpjInit that threads a boolean through the init message to the worker, which passes it to each JVM instance. It also updates documentation for warmSnapshot to explain that the image is only reused while every file read during warm-up remains unchanged, and recommends warming up with fixed files (e.g., a small unchanging source) before the first real compile. The typecheck passes and the changes are minimal and consistent across the five modified files.
review-bot, model nvidia/nemotron-3-ultra-550b-a55b:free, verdict approve
Pages can now see what a VM does with snapshots.
cheerpjInit({ debug: true })passesdebugto every VM the worker starts, as--debugdoes under Node. VM events go to the console, among them whether a warm snapshot was saved, skipped as busy (with the reason) or restored, and why a restore missed. Before this a page had no way to tell, which is why frc-dev-wasm could not see why warm snapshots gave its IDE no gain.The docs for
warmSnapshotnow also say how to use it. The image is reused only while every file the warm-up read is unchanged, so the first library calls should read fixed files, such as a compile of a small source that never changes. A first compile of the user's own project records that project's files and listings, so the image misses as soon as one of them changes, which is what happened in frc-dev-wasm's tests (each creates a new project).Checks:
pnpm typecheckpasses. The change only threads one boolean through the init message.