Blog/tutorial on melange compile time?

Is there a good blog/tutorial discussing Melange compile time and how to optimize it ?

Context: I’m building a game engine in Rust/Chrome/wasm32. Compile time is getting annoying again. I am considering using OCaml/Melange ↔ JS ↔ Rust/wasm32 integration.

So I am particularly interested in reading about Melange compile time and tricks for optimizing/minimizing incremental build times.

My situation is a bit weird in that I will be using almost NO OCaml libraries (not even React bindings), as nearly everything is done in Rust/wgpu, and the OCaml/Melange side is just for “scripting/driving” the Rust/wasm32 core.

Ideally, I am shooting for a situation where maybe we can do incremental builds of a 50k-100k OCaml/Melange project with incremental builds of < 1s (if possible at all) on a 50+ core machine.

Thanks!

From what I understand about your project, melange won’t be the most critical bit here. What would have the most impact is probably how you organise your project with dune. Are you using libraries? How do they depend on each other? Do you often modify deep libraries? Do you have some very large files? etc etc

Basically the goal would be for most modifications to trigger as little changes as possible and not to produce very large artifacts. I can’t say I’m an expert on that topic. But generally I’d advise keeping things very simple if speed is the target. For example I’d avoid introducing new libraries as much as possible, instead putting all the files together, making sure those files don’t grow too much, and that there are no files that can become chock points in the compilation pipeline.