

Ask HN: How much faster can asm.js (realistically) get? - bnjohnny

asm.js is really impressive. Engineering within limitations yet still producing something that runs http:&#x2F;&#x2F;beta.unity3d.com&#x2F;jonas&#x2F;AngryBots&#x2F;<p>(Try in Firefox 29+ for best results)<p>https:&#x2F;&#x2F;hacks.mozilla.org&#x2F;2014&#x2F;05&#x2F;asm-js-performance-improvements-in-the-latest-version-of-firefox-make-games-fly&#x2F;
======
matt42
Sometimes, I wonder why we spend billions trying optimized a javascript code
that will anyway run slower than a naive C/C++ app solving the same problem.
Part of the answer is that you just need one url, a browser to access an app:
Much simpler than downloading and installing a software.

From my point of view, in a near future, browsers will execute a language that
will be statically typed, not garbage collected, with support of multi-
threading (I mean real threads with shared memory, not webworkers), and
mapping to SIMD units (AVX, SSE, NEON, ...). That day, there won't be any
reason anymore for web apps to be slower than native apps. Plus, they will be
a lot more power efficient than the javascript vm.

------
bnjohnny
Is it possible that asm.js, since it's compiled dynamically on the client
(giving access to more information potentially leading to better
optimizations) can eventually out perform c/c++?

~~~
Scaevolus
You can do "profile-guided optimizations" in C++ as well. It's easier to
exploit CPU capabilities (e.g. AVX) if you run the compiler on the client
side, but once again compilers can do the same.

The latency requirements prevent some of the more aggressive and time
consuming optimizations from being attempted.

