3 ms·
>It's significantly faster than JS There doesn't appear to be much evidence to support this claim. In fact, there are benchmarks where Javascript outperforms W
by password54321 3y ago
>It's significantly faster than JS
There doesn't appear to be much evidence to support this claim. In fact, there are benchmarks where Javascript outperforms Wasm.
- kevingadd 3y agoIf you're solving the category of problems WASM is aimed at, it is almost always faster. If JS is faster it's probably because you're using it to do something that WASM wasn't designed for, i.e. DOM manipulation.
- password54321 3y agohttps://programming-language-benchmarks.vercel.app/javascript-vs-wasm https://programming-language-benchmarks.vercel.app/javascrip...
- kevingadd 3y agoThese aren't like-for-like comparisons, as demonstrated by how there are multiple implementations of each 'benchmark'. Picking the fastest JS and non-JS binary trees there, for example, the JS one relies on the garbage collector, which means that in practice it can bump allocate all of its temporary objects, and the GC will never run, so they will never be freed. The Rust one in comparison is allocating a bunch of ref-counted handles. It is automatically going to lose. EDIT: I dug around that site more and if you pull up 'JavaScript vs Rust' for the same benchmark, JS is still faster. So I don't understand why you're even using this for a 'JS is faster than WASM' argument if it appears to be saying that JS is also faster than Rust.
- password54321 3y ago>EDIT: I dug around that site more and if you pull up 'JavaScript vs Rust' for the same benchmark, JS is still faster. So I don't understand why you're even using this for a 'JS is faster than WASM' argument if it appears to be saying that JS is also faster than Rust. This doesn't appear to generally be the case and some outliers are to be expected in benchmarks. >'JS is faster than WASM' Was never the argument.