Most simply of all, the fast asm.js performance only exists in Firefox—and only in the unstable Nightly builds at that. This technology isn't in any stable version of Firefox, and it'll be some time before it will be.
Good spot, I will endeavour to get this fixed.[url=http://meincmagazine.com/civis/viewtopic.php?p=24545831#p24545831:2to4wycd said:ThermalNoise[/url]":2to4wycd]The Native code with SSE vs. asm.js chart has the wrong legend. "Firefox regular JS" should be "Native with SSE".
Very interesting article. Thanks for taking the time to thoroughly investigate the performance, Mozilla's numbers seemed a little too good to me too. I'm glad to be proven (mostly) wrong.
[url=http://meincmagazine.com/civis/viewtopic.php?p=24545925#p24545925:207sgrqf said:ccurtsinger[/url]":207sgrqf]You've given a very nice overview of asm.js, but I think the performance comparison is misleading. The output of Emscripten, whether asm.js or not, will not use JavaScript objects, dynamic types, etc., and will do virtually all of its computation on typed arrays. JavaScript written by humans tends to be much, much slower than equivalent native code (closer to 20x) because developers actually use the dynamic features of JavaScript on a regular basis, and spend little if any time manipulating typed arrays.
[url=http://meincmagazine.com/civis/viewtopic.php?p=24546019#p24546019:1tocvsj8 said:Faramir[/url]":1tocvsj8]I don't understand why people seem to think that every sort of program should run in a browser.
Triple A video games, scientific computing programs, and computer assisted design programs seem particularly ill suited to a web browser strait jacket, that nonetheless people are enthusiastically working on.
The number one answer seems to be that people trust the browsers' sandboxes which seems a) unwarranted and b) overkill for the problem of untrusted code.
[url=http://meincmagazine.com/civis/viewtopic.php?p=24546019#p24546019:4yynjxh7 said:Faramir[/url]":4yynjxh7]I don't understand why people seem to think that every sort of program should run in a browser.
Triple A video games, scientific computing programs, and computer assisted design programs seem particularly ill suited to a web browser strait jacket, that nonetheless people are enthusiastically working on.
The number one answer seems to be that people trust the browsers' sandboxes which a) seems unwarranted and b) seems like overkill for the problem of untrusted code.
You should check out URLquery.net and look at some of the browser exploit kits (the entries with high "Alerts/IDS"), and see how deep the eval loops go. Or look at a TDSS/tidserv update page that generate dynamic XOR keys.[url=http://meincmagazine.com/civis/viewtopic.php?p=24545787#p24545787:39j1j4ct said:Matty[/url]":39j1j4ct]
Sure you can obfuscate Javascript to some extent, but it is rare.
You can stream in programs other than web browsers. In fact, a web browser isn't a terribly great streaming platform.[url=http://meincmagazine.com/civis/viewtopic.php?p=24546057#p24546057:1ugwl425 said:styron[/url]":1ugwl425]Now I hardly care, and streaming has some advantages around multiple devices and not having to maintain media libraries etc.
Programs can auto-update themselves without having to run in web browsers. In fact, your web browsers is such a program.Apps moving to browsers is the same kind of progression. Yes it kind of sucks at the moment (especially for complex apps), but year by year it sucks less, and the advantages around not having to maintain software start becoming more compelling.
The final graph on the third page includes some comparisons to human JavaScript. One of them uses typed arrays.[url=http://meincmagazine.com/civis/viewtopic.php?p=24545925#p24545925:3vkym8i8 said:ccurtsinger[/url]":3vkym8i8]You've given a very nice overview of asm.js, but I think the performance comparison is misleading. The output of Emscripten, whether asm.js or not, will not use JavaScript objects, dynamic types, etc., and will do virtually all of its computation on typed arrays. JavaScript written by humans tends to be much, much slower than equivalent native code (closer to 20x) because developers actually use the dynamic features of JavaScript on a regular basis, and spend little if any time manipulating typed arrays.
I would like to look at NaCl too, but making it work is a little more involved than asm.js. If there's enough interest, it's certainly something I could take a look at.Also, I'm thoroughly surprised that there was no discussion of Google's NaCl (native client). Given a program in C or C++ (or any other language with an LLVM front-end) you could easily go either route. Of course NaCl doesn't play nicely with other platforms like asm.js does, but its performance is a lot more compelling than Dart so adoption looks just a bit more likely.
[url=http://meincmagazine.com/civis/viewtopic.php?p=24546057#p24546057:114ihudm said:styron[/url]":114ihudm][url=http://meincmagazine.com/civis/viewtopic.php?p=24546019#p24546019:114ihudm said:Faramir[/url]":114ihudm]I don't understand why people seem to think that every sort of program should run in a browser.
Triple A video games, scientific computing programs, and computer assisted design programs seem particularly ill suited to a web browser strait jacket, that nonetheless people are enthusiastically working on.
The number one answer seems to be that people trust the browsers' sandboxes which a) seems unwarranted and b) seems like overkill for the problem of untrusted code.
10 yrs ago I would wonder why people would want to stream music or video instead of downloading it and playing it locally.
That way they could play it again and again without wasting network traffic/bandwidth and they wouldn't have to put up with excessive compression, buffering headaches, broken connections etc.
Now I hardly care, and streaming has some advantages around multiple devices and not having to maintain media libraries etc.
Apps moving to browsers is the same kind of progression. Yes it kind of sucks at the moment (especially for complex apps), but year by year it sucks less, and the advantages around not having to maintain software start becoming more compelling.
It isn't about right now - it's about 5-10yrs time.
While the use of the academic "we" is commonplace, I wrote it first person singular, because some of the decisions might be considered idiosyncratic and were heavily dependent on my own value judgement; I felt that first person singular made it clearer who was making these decisions. In editing, however, it got rewritten as first person plural. For the purposes of this article, "we" refers exclusively to me.[url=http://meincmagazine.com/civis/viewtopic.php?p=24546357#p24546357:aq9mv9q2 said:pqr[/url]":aq9mv9q2]Very nice article, Peter, but with one serious flaw. Who are the 'we' you keep referring to? You should clarify whether this is the academic self, or there is credit due to other people.
I am working on getting this addressed; unfortunately, I don't create the graphs myself, as they're done in Keynote.On the lighter side, the SSE benchmark game figure is likely mislabeled (native code is strangely not fastest).
[url=http://meincmagazine.com/civis/viewtopic.php?p=24546385#p24546385:r0gtohlc said:DrPizza[/url]":r0gtohlc]While the use of the academic "we" is commonplace, I wrote it first person singular, because some of the decisions might be considered idiosyncratic and were heavily dependent on my own value judgement; I felt that first person singular made it clearer who was making these decisions. In editing, however, it got rewritten as first person plural. For the purposes of this article, "we" refers exclusively to me.[url=http://meincmagazine.com/civis/viewtopic.php?p=24546357#p24546357:r0gtohlc said:pqr[/url]":r0gtohlc]Very nice article, Peter, but with one serious flaw. Who are the 'we' you keep referring to? You should clarify whether this is the academic self, or there is credit due to other people.
[url=http://meincmagazine.com/civis/viewtopic.php?p=24546019#p24546019:oemos814 said:Faramir[/url]"emos814]I don't understand why people seem to think that every sort of program should run in a browser.
Triple A video games, scientific computing programs, and computer assisted design programs seem particularly ill suited to a web browser strait jacket, that nonetheless people are enthusiastically working on.
The number one answer seems to be that people trust the browsers' sandboxes which seems a) unwarranted and b) overkill for the problem of untrusted code.
[url=http://meincmagazine.com/civis/viewtopic.php?p=24546413#p24546413:2hfbsj8z said:krimhorn[/url]":2hfbsj8z]From a programming nerd perspective this is pretty cool. From a practical programming standpoint I wonder what's the point? Are people seriously looking to Javascript as the language to develop highly complex web applications? This effort would be better off looking to create a new client-side language without the terrible language design decisions that permeate every facet of Javascript.
As a web-dev I use Javascript, but as a web-dev I hate using Javascript.
[url=http://meincmagazine.com/civis/viewtopic.php?p=24546673#p24546673:3erfliw3 said:smoofles[/url]":3erfliw3]Their rendering engine still sucks balls. Fast computing only helps so much if you can't even get image scaling right or you engine starts acting up with complicated (HTML-based) scenes.
But, hey, good that they can run a 3D engine in the browser and offer a Social API. Who needs HTML/CSS rendering quality, amirite?
[url=http://meincmagazine.com/civis/viewtopic.php?p=24545663#p24545663:1wbjoe6b said:dacjames[/url]":1wbjoe6b]It should be noted that asm.js is a very young project and the native compiler in Firefox still needs a lot of work. You should expect the performance to improve significantly in the next few versions. Things will get even better if/when Google and/or Apple starts competing on asm.js compilation.
The world is truly a bizarre place when the best hope for near-native performance on the web is a set of clever syntax hacks on top of fully-dynamic language.
[url=http://meincmagazine.com/civis/viewtopic.php?p=24546057#p24546057:7wswfjbd said:styron[/url]":7wswfjbd][url=http://meincmagazine.com/civis/viewtopic.php?p=24546019#p24546019:7wswfjbd said:Faramir[/url]":7wswfjbd]I don't understand why people seem to think that every sort of program should run in a browser.
Triple A video games, scientific computing programs, and computer assisted design programs seem particularly ill suited to a web browser strait jacket, that nonetheless people are enthusiastically working on.
The number one answer seems to be that people trust the browsers' sandboxes which a) seems unwarranted and b) seems like overkill for the problem of untrusted code.
10 yrs ago I would wonder why people would want to stream music or video instead of downloading it and playing it locally.
That way they could play it again and again without wasting network traffic/bandwidth and they wouldn't have to put up with excessive compression, buffering headaches, broken connections etc.
Now I hardly care, and streaming has some advantages around multiple devices and not having to maintain media libraries etc.
Apps moving to browsers is the same kind of progression. Yes it kind of sucks at the moment (especially for complex apps), but year by year it sucks less, and the advantages around not having to maintain software start becoming more compelling.
It isn't about right now - it's about 5-10yrs time.
[url=http://meincmagazine.com/civis/viewtopic.php?p=24546803#p24546803:3cwtvhdq said:fuzzyfuzzyfungus[/url]":3cwtvhdq][url=http://meincmagazine.com/civis/viewtopic.php?p=24545663#p24545663:3cwtvhdq said:dacjames[/url]":3cwtvhdq]It should be noted that asm.js is a very young project and the native compiler in Firefox still needs a lot of work. You should expect the performance to improve significantly in the next few versions. Things will get even better if/when Google and/or Apple starts competing on asm.js compilation.
The world is truly a bizarre place when the best hope for near-native performance on the web is a set of clever syntax hacks on top of fully-dynamic language.
I wonder if any of the guys responsible for the (misleading, marketing driven) choice to call Javascript "javascript", and connect perception of it to the pretty-much-entirely-unrelated 'Java' language and VM find it amusing that, if current trends continue, a performance-optimized-subset of javascript will very likely be the web's target 'VM' architecture of choice, despite java actually being intended to do that and javascript being a series of wacky hacks originally intended for something else entirely?
[url=http://meincmagazine.com/civis/viewtopic.php?p=24546019#p24546019:224ykej9 said:Faramir[/url]":224ykej9]I don't understand why people seem to think that every sort of program should run in a browser.
Triple A video games, scientific computing programs, and computer assisted design programs seem particularly ill suited to a web browser strait jacket, that nonetheless people are enthusiastically working on.