web-dsp
web-dsp copied to clipboard
webassembly is slower than javascript
I have seen a nice video which was talking about performance of web-assembly, but running your example the javascript is playing with similar speed, but on the graph it has been shown that the wasm is -97% is faster than javascript.
https://youtu.be/6v4E6oksar0?t=1796
my green line is showing 2.3, and my blue line is showing 400-500
Same here. Running on chrome (on pixel) , getting a stable -28% webasm vs js.
My observations of the demo, with 64-bit Firefox Nightly for Windows on a Surface Book (i7-6600U, using integrated graphics):
- For most of the filters, WebAssembly averages 10–40% slower than JavaScript;
- For some of the filters, WebAssembly averages −10%–40% faster than JavaScript;
- For Super Edge, WebAssembly averages 10–20× faster than JavaScript;
- Beards look even cooler than normal with Super Edge (though I wouldn’t want my beard to look like that in real life).
Same. On different filters values vary between -77 to -99%.
Chrome Version 61.0.3163.100 (64 bit). Windows 10.
Same here. Google Chrome. Version 62.0.3202.75 (64-Bit) Windows 10
Same here. Google Chrome. Version 62.0.3202.75 (64-Bit) Windows 8 Generally I cannot find a single benchmark or demo where WebAssembly is faster than JS, though there are rumors and stories.. and this the videio demo.
Edit: Firefox shows similar slowness.
For the simple filters like Grayscale and Invert JS is faster. Once the filters get computation complex, like Gaussian Blur WebAssembly is 50-100% faster. Which matches what you would expect because there is data transfer overhead.
Version 63.0.3239.84 (Official Build) (64-bit)
Same on firefox, Macbook Air 2014
I'm getting 40% better FPS on Gaussian Blur with JS, is it possible that Chrome has some optimization and runs the filters on the GPU?