AS3 vs. JavaScript Performance Followup (November 2013)
It’s been about seven months since my last test of AS3 versus JavaScript and there have been several major releases of both browsers and the Flash Player. Today, we pit every major browser against each other and Flash Player itself to get an updated picture of which provides the fastest scripting environment on the web.
Since last time, the following releases have occurred:
Platform | Last Test | Today’s Test |
---|---|---|
Flash Player | 11.6.602.180 | 11.9.900.117 |
Opera | 12.14 | 17.0.1241.53 |
Chrome | 26.0.1410.43 | 30.0.1599.101 |
Firefox | 20.0 | 25.0 |
Internet Explorer | 10.0.9200.16521 | 11.0 |
I performed all of these tests in a very similar environment as last time:
- ASC 2.0 build 354071 (
-debug=false -verbose-stacktraces=false -inline
) - 2.8 Ghz Intel Xeon W550
- Windows 7 SP1 64-bit
I assign “points” to each platform based on its performance ranking on each test. There are five platforms in this test, so the first place platform gets five points, the second platform gets four points, and so on. Say there is a three-way tie for first place. In that case, each tying platform gets five points and the next-best platform gets two points and the platform after it gets one point.
Here are the points awarded:
Platform | JavaScript (Firefox 25.0) | JavaScript (IE 11.0) | JavaScript (Chrome 30.0.1599.101) | JavaScript (Opera 17.0.1241.53) | AS3 (Flash 11.9.900.117) |
---|---|---|---|---|---|
Test 1 | 3 | 3 | 5 | 5 | 1 |
Test 2 | 5 | 4 | 2 | 2 | 3 |
Test 3 | 4 | 1 | 3 | 3 | 5 |
Test 4 | 4 | 1 | 3 | 3 | 5 |
Test 5 | 1 | 4 | 4 | 4 | 5 |
Test 6 | 3 | 3 | 5 | 5 | 1 |
Test 7 | 3 | 3 | 5 | 5 | 1 |
Test 8 | 2 | 1 | 5 | 5 | 3 |
Test 9 | 4 | 5 | 2 | 2 | 3 |
Test 10 | 3 | 2 | 5 | 5 | 1 |
Test 11 | 1 | 3 | 5 | 5 | 2 |
Test 12 | 1 | 5 | 5 | 5 | 5 |
Total | 34 | 35 | 49 | 49 | 35 |
To compare these results to previous tests, let’s look at percentile of each platform’s points:
Product | November 2012 | April 2013 | November 2013 |
---|---|---|---|
Flash Player | 100% | 77% | 71% |
Opera | 79% | 83% | 100% |
Chrome | 100% | 100% | 100% |
Internet Explorer | 75% | 72% | 71% |
Firefox | 91% | 100% | 69% |
In using the same Blink engine as Google Chrome, Opera has made a huge leap forward in performance and now shares the lead with Google Chrome which maintains the top spot. Firefox has fallen from sharing the top spot to now being on-par with both Flash and Internet Explorer, neither of which substantially improved their performance since the last test. What happened to Firefox? If anyone knows, please let me know in the comments.
To address the “AS3 vs. JavaScript” title of this series of articles, AS3 is now more firmly in the second tier of performers with Firefox and Internet Explorer. Gone are the days where it dominated poor performances by the likes of Internet Explorer delivered a 10x slowdown compared to the fastest performers. Meanwhile, the Blink-powered browsers—Google Chrome and Opera—lead the way with outstanding JavaScript execution speed.
As usual, the above test is only a simple test suite from oddhammer.com and not a comprehensive test of all features under all conditions. As such, I recommend viewing the above results only as a broad perspective on overall performance. For specific performance characteristics, check out the other AS3 and JavaScript articles on this site and stay tuned for plenty more!
Raw data spreadsheets: Open Document Format (ODS) , Excel (XLS).
Spot a bug? Have a suggestion? Post a comment!
#1 by alebianco on November 11th, 2013 ·
Just a question, from what the oddhammer page says, looks like the flash code used for the tests is AS2 run in old flash players, what kind of changes (if any) did you made to the sources to target the latest players?
#2 by Q on November 11th, 2013 ·
AS2 and ASC2(Action Script Compiler 2) is different. He use AS3 code and compile by ASC2.
#3 by Ben on November 11th, 2013 ·
Hmm, I had a look at the raw data and the only test where AS3 is significantly slower seems to be the array.join test. The other test tend towards a time of 0 make results like the ones in test 6 seem a bit strange. The point system doesn’t represent the raw time data very well in my opinion. 1 ms difference can be created due to measurement errors and to give AS3 only 1 point because it is 1 ms slower than the rest (that have values of 0 and 1) seems a bit exaggerated (or FF in Test 5).
But I see the problem with using the sum of times, because Chrome and Opera would lose mostly because of Test 2 (sorting) and that would not be true overall.
To be honest it would be more fair to base the results on the raw times in each test and not on the points.
Maybe increasing the repetitions by a factor and dividing the result by that factor would result in a more precise result in the problematic tests (3, 4, 5, 6, 8, 10 and 12).
#4 by jackson on November 11th, 2013 ·
It’s definitely a tricky test to compare overall functionality of the various browsers plus Flash. I used to use the sum of their times (row 15) but decided it wasn’t fair because some tests (e.g. 2) take much longer than other tests (e.g. 12). So I came up with the “points” scheme which I think is more fair. I agree though that there are some seemingly-unfair cases such as test 12 where Firefox took 1 millisecond and the others took 0. This resulted in all platforms getting 5 points except Firefox which got 1: a 4 point drop. Perhaps in a future version of this test I’ll break with the Oddhammer framework and design my own suite of tests to overcome some of these difficulties. In the meantime, I think the results are reasonably fair from a very broad view of performance.
#5 by Nicolas on November 11th, 2013 ·
Fantastic. Now if only the browser had a native, strongly typed, statically typed language available, I’d make the jump. Until then, happy JS hacking.
#6 by thecookie on November 13th, 2013 ·
Dart and dart2js. https://plus.google.com/118397406534237711570/posts/7njhnbMCRNa
#7 by jackson on November 13th, 2013 ·
JavaScript isn’t statically typed and probably will never be, but there are a lot of statically-typed languages that compile to JavaScript. Especially popular are CoffeeScript and TypeScript.
#8 by jusopi on January 31st, 2014 ·
I have to make the jump from as3 to JS over the last year. @Nicolas, once you accept JS for the quirky little language it is, it’s like a breath of fresh air. I’ve even done some game dev with it and it’s amazing how easy it is. While you won’t get static typing anytime soon, the ECMAScript 6 proposal will present some more classic OO paradigms such as class declarations & inheritance.
@jackson the issue with CoffeeScript & TypeScript especially (so I’ve heard, never bothered to test myself) is that the “compiled” JS is ofttimes very under performant than would be if it were written in JS originally. Now how they determined that, I have no idea. And with my little exposure to TypeScript, there are API wrappers that you must also support and update if you plan to use any external libs. I’m sure that is trivial for highly adopted libraries like jQuery and such, but take Phaser.JS or the JS port of the Ash Entity Framework, it’s something that might be an added step in your process.
#9 by zermok on August 8th, 2017 ·
Firefox became a “toy” of google inc.
their headquater is only at one block from google in san francisco.
btw, people think that firefox is an open source entity maintained by hobbyist but absolutely not.
fully controlled by google money
#10 by zermok on August 8th, 2017 ·
Actionscript is much more cleaner and easy to program,
javascript lacks in multithread, reacting differently between each browser and version, so it’s a nightmare for those who want the website/application fully compatible