Hacker News new | ask | show | jobs
by oefrha 1432 days ago
The difference in performance is about 3x and it looks like an pretty ideal case for wasm. Seems to match observations from Zaplip portmortem:

> Rust is faster than JS in some cases, but those cases are rarer than we expected, and the performance gain is on the order of 2x some of the time, not 10x most of the time.

https://zaplib.com/docs/blog_post_mortem.html

3 comments

That 2x figure is something that shows up consistently over the years, since asm.js in fact. The 10x cases are rare, like they found. Still, 2x is enough to justify using a different language in some cases.

Separately, though, on very large applications wasm does have an advantage on startup times: there is no warmup period as the JIT learns the types, no sluggish first frames for the entire application or the first time you click on a feature that hits a new code path. For something like Photoshop or a game engine that can be a very big deal. But, again, this type of application is not the most common, so JS will remain the best option for most things.

> it looks like an pretty ideal case for wasm

I'm really not so sure about this (see my comment further down[1]) but I'd love someone more knowledgeable to chime in.

[1]: https://news.ycombinator.com/item?id=32108144

> pretty ideal case for wasm

It's not a bad use case for JS too. I'm sure there will be problems more biased into one of the languages than this.