Does it make sense to create a Wasm build of this for the browser? Or is the speedup mainly due to the browser spawning step rather than execution/rendering itself?

I reckon the main speed up is from not having to launch a browser.

Mermaid can also be used inside the browser directly, I believe. The WASM compiled Rust implementation could still outperform it.

Exactly, that's what I wanted to know. No other way to find out than to test, though. Don't know how easy it would be to wire it up.