4 ms·
What you say is true, Chrome is using a general approach to optimize asm.js code, but that does not contradict what the post says. It says that both Firefox and
by azakai 13y ago
What you say is true, Chrome is using a general approach to optimize asm.js code, but that does not contradict what the post says. It says that both Firefox and Chrome have optimized for asm.js, and that's correct. For example as reissbaker's comment mentions, Google even added an asm.js benchmark to Octane 2.0. That shows it is optimizing for that style of code, among many other styles of course.
- nolok 13y agoThat's one tortured and oriented way of looking at it. By your logic, every single dev who has ever made a js lib can make an article titled "Chrome and Opera Optimize for Whoever-Pioneered whatever.js", since the changes improve their lib. That title is making it sound like the changes were aimed at making that one case faster, when they weren't. And them adding a library to their benchmark doesn't in any way mean that they aim to optimize for it, only that they want to keep a reference on how their code perform. Just because I regularly check how my website renders in IE 6 doesn't mean I'm optimizing for it or that I consider it a target.
- azakai 13y ago> That title is making it sound like the changes were aimed at making that one case faster, when they weren't. No, the changes were certainly aimed at making the case of asm.js code faster. As in the links I posted above, Google has announced they are optimizing for asm.js and that they achieved large speedups on it, they mention it very specifically, http://culturemass.com/2013/05/17/google-io-2013-keynote-part-ii/ http://culturemass.com/2013/05/17/google-io-2013-keynote-par... http://blog.chromium.org/2013/11/announcing-octane-20.html http://blog.chromium.org/2013/11/announcing-octane-20.html > And them adding a library to their benchmark doesn't in any way mean that they aim to optimize for it No, it exactly means that: Adding it to Google's main benchmark means that they consider it representative of important real-world code, and hence that optimizing for that benchmark means you are optimizing for the right stuff. As the Octane FAQ says, >> " Octane aims to be representative of actual workloads and execution profiles of real web applications. Octane's goal is to be a proxy for the JavaScript application that you'll encounter when running browser games, highly-interactive web pages or online productivity tools." https://developers.google.com/octane/faq https://developers.google.com/octane/faq
- pfraze 13y agoI think there's probably a subtle distinction that's hard to show. I'd imagine the line is drawn at interpreting the "use asm"; which signals the asm.js optimizations should be used. Instead, I'd bet the Chrome team are just watching for JS which matches the asm.js spec and optimizing for those cases, like they do for other code paths & structures. That would mean they are optimizing for it, but not supporting it directly.
- mraleph 13y ago> Instead, I'd bet the Chrome team are just watching for JS which matches the asm.js spec No. All optimizations that V8 are doing are following from the JavaScript specification itself, not from asm.js specification. V8 does not use asm.js specification in any way (including type rules that asm.js prescribes). If you take asm.js code and slightly change typing so that it will no longer pass asm.js type check but still be reasonable V8 will continue to optimize what it can.
- pcwalton 13y agoI'd say that if you make changes to your web site because you see that your site is slow in IE6 in order to make IE6 faster, you are optimizing for IE6. This is directly analogous to what Google is doing with asm.js.
- mraleph 13y agoIf you make changes to your site that make both IE6 and all other browsers fast, then what are you optimizing for? Because this is what is happening. asm.js is as a monolith: "use asm" in the foundation and a pyramid of typing rules, take one out everything crumbles. Right now V8 does not use "use asm" nor relies on any static typing (beyond what can be derived from JavaScript specification). For example when V8 improves its optimization pipeline to handle coercion of boolean to integer inline this helps asm.js code, but it also helps anyone doing this operation outside of asm.js specification compliant code. This coercion rule is just a part of the language, so I really see this as optimization of JavaScript as whole.
- mercurial 13y ago> If you make changes to your site that make both IE6 and all other browsers fast, then what are you optimizing for? If you specifically make changes to your site in order to make faster on IE6, and it also makes all other browsers fast, the "all other browsers" part is best described as a side-effect.
- andreypopp 13y ago> If you specifically make changes to your site in order to make faster on IE6, and it also makes all other browsers fast, the "all other browsers" part is best described as a side-effect. So did the v8 team do something specially to make asm.js faster? As mraleph said, the answer is no. So the fact that asm.js is now faster in Chrome is side-effect.
- azakai 13y agoAgain, the question is what you mean by "specifically". The v8 team look at asm.js benchmarks and make changes in v8 to make those benchmarks run faster, that's clear from their announcements. At the same time, those optimizations can also make other code faster, as they try to make them general optimizations as much as possible. So it's not true it's a "side-effect", since some of the time they literally start the process by looking at asm.js code, and finding how to make it run faster on v8. So asm.js is in a sense directly responsible for the optimization, and asm.js is sped up by it. But at the same time, the optimization added is - unlike Firefox's approach - relatively general, and helps other code too. In the end, I don't think there is any disagreement between us here.
- coldtea 13y ago>And them adding a library to their benchmark doesn't in any way mean that they aim to optimize for it In what bizarro world? >only that they want to keep a reference on how their code perform That's the very definition of optimization (and avoiding regressions).
- nashashmi 13y agoTo add to the comments here, asm.js seems to be big on bitwise computing. In fact it is totally relying on bitwise computing. So asm.js put bitwise computing at the forefront of programming. Which means that Chrome will now optimize for bitwise computing without holding any bias for or against asm.js. Asmjs developers can claim the mantle of bitwise computing and anybody who uses bitwise computing or optimizes for bitwise computing is really endorsing asm.js