

Superfast asm.js benchmarks of V8 TurboFan - Pharohbot
http://arewefastyet.com/#machine=28&view=breakdown&suite=asmjs-ubench

======
azakai
1\. That is on 32-bit, for fairness it's worth mentioning that Safari is slow
there because its FTL JIT is 64-bit only.

2\. Firefox would also be faster on 64-bit as well (less significantly).
However, TurboFan results aren't showing up on the 64-bit bot - not sure if
that's an issue with the bot, or if TurboFan doesn't build on 64-bit yet.

3\. Those are microbenchmarks, for more realistic workloads click on "apps",
which leads to
[http://arewefastyet.com/#machine=28&view=breakdown&suite=asm...](http://arewefastyet.com/#machine=28&view=breakdown&suite=asmjs-
apps)

~~~
zobzu
Looks more like firefox + ion monkey is superfast on asm.js, not chrome

which.. actually reflects reality.

------
desdiv
How the hell did C++ lose to Javascript on the first benchmark!?

And it's not just a little slower either, it's 36% slower than the fastest
Javascript implementation.

~~~
vardump
Plain C++ can easily lose to JITted scripting languages. Nothing new or weird
in that. Remember, we're comparing native code to native code.

~~~
accurrent
Not true actually theres always a JIT overhead for the compiler.

~~~
vardump
There's also a significant overhead for not being able to target exactly the
CPU model and parameters for the call at compile time. Unless of course doing
profile guided optimization just for that CPU model and use case.

I've been playing around with an idea for a long time to write a JIT for
native code. I think it's possible to speed up most _native_ code by JITting
it. Sadly it would take much more time I can afford to spend. The principle is
sound, though.

It'd be possible to eliminate a lot of computation at runtime. Remove a lot of
branches, use CPU model specific instructions when a suitable pattern is
detected, etc. Functions could be simplified to constraints, function calls
could be dynamically inlined. Spilled stack variables could be allocated in
registers. Calling conventions optimized into passing more parameters in the
registers. On register starved 32-bit x86, registers for parameters with
effectively constant values could be converted into instructions with
immediate values, saving registers for actually changing data.

There's also no reason why you can't cache previously JITted code into a file.

------
cromwellian
Is Turbofan even beta yet? Seems a bit early, it performs worse than
crankshaft on some code at the moment.

