Is there load-in lag for wasm functions compared to normal js functions? For example, if I had a wasm math library, and wanted to call a function immediately when the page loaded, would it be able to start returning results as fast as if I just called a native js math function? Or would there be a few seconds while the library loaded/compiled/whatever?
The paper Mind the Gap: Analyzing the Performance of WebAssembly vs. Native Code reports that, on average, WebAssembly is running at 67% of native speed in Firefox and 53% of native speed in Chrome (called 50% slower and 89% slower in the paper). Whether 67% can be called "near" 100% or not is subjective.
For context, these figures are roughly in line with what Java, C#, and other "fast" managed runtimes manage on the Benchmarks Game. [0] Since WASM's MVP is designed towards manual memory management(GC is proposed but not yet specified), there is a good likelihood of the results improving beyond these runtimes.
That paper does not report "WebAssembly is running at 67% of native speed in Firefox and 53% of native speed in Chrome".
That paper reports — "… applications compiled to WebAssembly run slower by an average of 50% (Firefox) to 89% (Chrome), with peak slowdowns of 2.6× (Firefox) and 3.14× Chrome)."
When you write "53% of native speed" that's really confusing!
Sorry, I reformulated the findings for easy consumption. Why is it confusing and not an improvement? Ask 10 people what speed is 89% slower than 100 mph. See how many give the article's intended answer (53 mph).
11 comments
[ 1.7 ms ] story [ 42.2 ms ] threadIs this currently true or is this more about what the future hopefully looks like?
I recall reading that wasm is an in-progress thing and really isn't that fast in comparison yet.
major implementations are working on more efficient baseline compilers to further improve performance.
[0] https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
That paper reports — "… applications compiled to WebAssembly run slower by an average of 50% (Firefox) to 89% (Chrome), with peak slowdowns of 2.6× (Firefox) and 3.14× Chrome)."
When you write "53% of native speed" that's really confusing!
Have you done that?