Javascript JITs are really good, you (likely) aren't going to see major performance improvements by dropping into WASM.

That said, one major benefit of WASM that Javascript jits will have a hard time competing with is GC pressure. So long as your WASM lib focuses on stack allocations, it'll be real tough for a Javascript native algorithm doing the same thing to compete (particularly if there's a bunch of object/state management).

For a hot math loop doing floating point calcs (mandelbrot calc), however, I've seen javascript end up with identical performance compared to WASM. It's really pretty nuts.

>aren't going to see major performance improvements by dropping into WASM

I think that might also change as they add proposal and roadmap items like "direct access to the DOM"[1] to WASM.

Proposals: https://github.com/WebAssembly/proposals

Roadmap: https://webassembly.org/roadmap/

[1] https://github.com/WebAssembly/interface-types/blob/master/p...

Edit: Overall, the proposals seem to be pushing WASM closer to being a general purpose VM (VM as in JVM, not KVM).