V8 supports asm.js as any other ES3-compliant JavaScript engine. It also has many optimizations in place which benefit from asm.js-style code. Asm.js-style code also simply doesn't do those expensive JavaScript-y things. That's why that Citadel demo runs just fine in Chrome, too.
However, V8 doesn't have a separate mode. The "'use asm';" pragma is ignored.
The Octane benchmark suite does contain Emscripten and Mandreel benchmarks though. So, they are tracking it and they also try to make this kind of code run faster.
Not only that, a few months after asm.js was included in Firefox, Chrome had optimizations done that helped a great bit with asm.js (http://blog.chromium.org/2013/05/chrome-28-beta-more-immersi...). Possibly a coincidence, but they certainly seem to care about asm.js performance above and beyond generic JS performance, even if they're not going to support the pragma.
> but they certainly seem to care about asm.js performance above and beyond generic JS performance
That doesn't follow. They certainly care about it; it's now in the Octane benchmark suite, which means they think it's representative of code that should be optimized for, but it's only part of the suite, which means it's just one more style of code that should be able to run efficiently in a modern JS engine.
You're oth saying the same thing for the most part, I dont think he's trying to imply that its their focus, just that its important enough to optimise specifically.
Nobody will see any benefits from JSCore being "faster than V8 on asm.js".
In fact, if JSC is slower on non asm.js code, the comparison would also be extremely misleading too, because 99.9999% of web code is NOT asm.js.
At the moment it's like saying "JSC is faster than v8 on a synthetic benchmark almost nobody really uses in the actual world, and v8 hasn't bothered optimizing for".
Obviously, people using asm.js will benefit from JavaScriptCore being faster than V8 on asm.js.
Whether it matters is an interesting question, but V8 developers seem to disagree with you, because they included asm.js benchmark in Octane benchmark suite, which V8 developers use to tune V8.
>Obviously, people using asm.js will benefit from JavaScriptCore being faster than V8 on asm.js
Also obviously I covered that, when I wrote "99.9999% of web code is NOT asm.js". So who are these "people"? All 10 of them?
>Whether it matters is an interesting question, but V8 developers seem to disagree with you, because they included asm.js benchmark in Octane benchmark suite, which V8 developers use to tune V8.
If anything, it shows that they agree with me. See how I compared asm.js to a "synthetic benchmark" in my comment?
V8 doesn't have any specific optimizations for asm.js, opting instead to focus on optimizing JavaScript as a whole (which asm.js also benefits from). That's their choice, and this is the result of that.
Because nobody (for large values of "nobody") cares for asm.js. 99.999% of Javascript code out there is not asm.js, and nobody really uses it at the moment for production/business. Some PoC games mainly.
So the fact that it beats V8 on something:
a) V8 does not implement,
b) requires specifically written (actually "compiled" from things like emscripten) JS code,
c) is irrelevant at the moment for JS performance on the web,
> Because nobody (for large values of "nobody") cares for asm.js.
The most important games companies - Unity, Epic, etc. - care very much about asm.js. Unity is going into beta very soon. Expect to see games after that.
> So the fact that it beats V8 on something: a) V8 does not implement
jsc also does not "implement" asm.js, in the sense that both v8 and jsc do not detect asm.js code specifically using the asm.js type system. Yet, jsc beats v8.
asm.js code is going to matter because games matter. Those games are using plugins now, but plugins are going away, and asm.js is the best option after that - that's why the games industry is adopting it.
Games are not "using plugins" today. They are either shipped as console games on DVDs/BluRays, or as native apps you download and run either for PC/Mac/tablet OS's.
asm.js is a bizarre hack. You're sending someone assembly code for a CPU that doesn't exist, as text.
It would have been far superior to just figure out CPU family specific sandboxes as NaCL did, and then accept that only two CPU architectures matter these days: x86 and ARM. If you can sandbox both, you're done and if someone wants to invent some super-duper new ISA they can damn well make code easily sandboxed when they design it.
I don't think that's a fair way to describe things - for one thing, NaCl is not portable, and PNaCl (which is) took years to materialize, at a point in time when it is not clear which option is better between PNaCl and JS.
Maybe irrelevant today, but maybe not irrelevant tomorrow.
JavaScript is what the web "runs on", and if Firefox might in the future provide the fastest way to run JavaScript. Obviously for most cases that isn't going to be that relevant, but I can imagine a situation where you have Photoshop-in-the-browser and it runs better on Firefox due asm.js.
If you care a lot about 99.9999% of web code, as in code found on real webpages, try JSBench <http://jsbench.cs.purdue.edu>. It's the only JS benchmark made from JS found in actual real-world production webpages. JavaScriptCore clocks all the other JS engines on it by a ridiculous margin.
It's neat that V8 is fast on long-running code that's not asm.js, but it's wrong to extrapolate that to most real-world web code.
ASM enables developers to run code at an order-of-magnitude as fast as native. This in-and-of-itself is important. While 99.999% of JavaScript may not be transcompiled from LLVM, that doesn't mean it isn't a powerful tool.
Apple may not care about such use cases. The fact that they could get ASM speedups for free is pretty cool. : )
Because if they're saying the new webkit jsc (using asm.js) is faster than V8 (not using using asm.js), then it's not really a fair comparison.