In most of the benchmarks I have done, I see Wasm being about 0%-5% slower than asm.js in Firefox, if 64-bit integers are not being used. If computation is 64-bit int heavy, then Wasm naturally wins. The performance loss in wasm in Firefox is due to a couple of spec issues that Wasm has at a disadvantage compared to asm.js, but these are being worked on (one such is https://github.com/WebAssembly/design/issues/986, another one is function pointer calls)
In other browsers Wasm is much faster than asm.js, because other browser vendors never optimized for asm.js as heavily as Firefox did. Firefox still has a performance advantage over other browsers on both asm.js and wasm the last time I benchmarked, but undoubtedly other browsers will quickly catch up. 2017-07-19 20:24 GMT+03:00 Floh <[email protected]>: > From my experience it depends a lot on the browser, tested code and even CPU > model... > > With most of my code I see about the same speed or a slight advantage for > WASM, I have one demo (on Firefox) where WASM is 25% faster than the asm.js > version (this demo in Firefox Nightly on Windows, with 1024k Dragons, don't > bother with the current stable Firefox version, the demo triggers a crash > bug which has only been fixed a few days ago): > > http://floooh.github.io/oryol-samples/wasm/Dragons.html > > As a rule of thumb I would expect about the same speed from asm.js vs > WebAssembly for most real-world code (the big advantage of WebAssembly is > faster startup for large demos, and slightly smaller download size). > > Cheers, > -Floh. > > Am Mittwoch, 19. Juli 2017 19:14:45 UTC+2 schrieb Jayesh Salvi: >> >> Hi, >> >> I ran a performance test with the emscriptened LAPACK module, between two >> targets asm.js and WASM. The test performs a mathematical task (computing >> the equation of line passing through 10000 points using least squares >> approximation, which invokes LAPACK routines underneath). I ran it on >> Firefox 54 (64-bit) on Linux. I didn't see any significant difference >> between the running times with two versions of lapack. In fact asm.js-LAPACK >> was a bit faster than WASM-LAPACK. >> >> asm.js LAPACK time = 120.8 msec >> WASM LAPACK time = 125.4 msec >> >> You can see the code here >> https://github.com/bluemathsoft/bluemath/blob/master/test/perf-index.ts >> >> Is this expected? Or is it too early in development of WASM to compare its >> speed with asm.js? >> >> Thanks. >> -- >> Jayesh > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
