3 ms·
I've written all my Advent of Code 2016 puzzles in Rust that I've then compiled to asm.js and WebAssembly and both asm.js and WebAssembly always outperformed th
by CryZe 10y ago
I've written all my Advent of Code 2016 puzzles in Rust that I've then compiled to asm.js and WebAssembly and both asm.js and WebAssembly always outperformed the idiomatic JavaScript solutions by a factor of 10x and sometimes even up to 40x. Firefox has the best asm.js and wasm support, with Edge being the second fastest browser and Chrome being the slowest (I only tested those 3). WebAssembly is always faster by about 10% in all the browsers than asm.js. However asm.js supports vector instructions and wasm doesn't. So when your inner loops are vectorized your asm.js even runs as fast in Firefox as the same code compiled as native code.
- icefox 10y agoDo you have a link to your puzzles or perhaps a blog entry with a more full write up of your findings? There are not too many examples like this in the wild yet and another data point would be interesting.