AS3 vs. JavaScript Performance Followup (March 2011)
It’s been about 9 months since my last test of AS3 versus JavaScript and there have been several major releases. I’ve held off on an update to this series since the two most widely used browsers—Internet Explorer and Firefox—have been approaching significant new versions. In the meantime, Adobe has released Flash Player 10.2 as we’ve seen in my performance update series (part one, part two, part three). Today, we pit every major browser against each other and Flash Player itself to get an updated idea of which provides the fastest scripting environment on the web.
This version of the performance test has two changes in testing methodology. Firstly, I’ve upgraded my PC test environment to a 2.8 Ghz Intel Xeon W3530 running Windows 7. This means that all previous test scores must be discarded and new scores taken for all browsers. As a result, I won’t be comparing any of the older browser versions against the current versions.
Secondly, I’ve decided to score the tests differently. In the past, I’ve taken a simple sum of all 12 test times as the platform (browser or Flash Player) total score. Since the tests vary so much in total time and one bad test can seem to ruin a whole platform, a new scheme is needed. In this version of the test, I now assign “points” to each platform based on its performance ranking on each test. There are six platforms in this test, so the first place platform gets six points, the second platform gets five points, and so on. Say there is a three-way tie for first place. In that case, each tying platform gets six points and the next-best platform gets three points, the platform after it gets two points, and the last place platform gets one point. Hopefully, this scheme will result in a more accurate overall picture of each platform’s performance.
With those changes in mind, let’s look at the performance results graph:
These results show a heated performance race. Internet Explorer used to be extremely far behind the competition, but the latest version changes that entirely. IE is now in a dead heat with Google Chrome, Firefox, and Opera. Only Safari lags behind in the JavaScript world. As for AS3, its performance solidly bests that of the competition and it is the standout leader. Here are the points in table format:
Platform | JavaScript (Firefox 4.0.0) | JavaScript (IE 9.0.8112.16421) | JavaScript (Chrome 10.0.648.204) | JavaScript (Safari 5.0.4) | JavaScript (Opera 11.01) | AS3 (Flash 10.2.154.25) |
---|---|---|---|---|---|---|
Test 1 | 4 | 5 | 6 | 3 | 2 | 1 |
Test 2 | 6 | 4 | 1 | 2 | 5 | 3 |
Test 3 | 2 | 1 | 4 | 3 | 5 | 6 |
Test 4 | 3 | 1 | 4 | 3 | 5 | 6 |
Test 5 | 6 | 4 | 1 | 4 | 4 | 6 |
Test 6 | 6 | 6 | 2 | 2 | 6 | 6 |
Test 7 | 2 | 4 | 6 | 5 | 1 | 3 |
Test 8 | 3 | 4 | 5 | 2 | 1 | 6 |
Test 9 | 1 | 6 | 2 | 4 | 3 | 5 |
Test 10 | 4 | 5 | 6 | 2 | 2 | 3 |
Test 11 | 3 | 2 | 6 | 1 | 5 | 4 |
Test 12 | 6 | 3 | 1 | 3 | 5 | 5 |
Total | 46 | 45 | 44 | 34 | 44 | 54 |
And here are the raw times behind the points:
Platform | JavaScript (Firefox 4.0.0) | JavaScript (IE 9.0.8112.16421) | JavaScript (Chrome 10.0.648.204) | JavaScript (Safari 5.0.4) | JavaScript (Opera 11.01) | AS3 (Flash 10.2.154.25) |
---|---|---|---|---|---|---|
Test 1 | 37 | 34 | 7 | 38 | 49 | 121 |
Test 2 | 43 | 84 | 398 | 135 | 44 | 120 |
Test 3 | 18 | 24 | 9 | 16 | 3 | 0 |
Test 4 | 21 | 22 | 7 | 21 | 1 | 0 |
Test 5 | 1 | 2 | 4 | 2 | 2 | 1 |
Test 6 | 1 | 1 | 2 | 2 | 1 | 1 |
Test 7 | 48 | 46 | 32 | 43 | 84 | 47 |
Test 8 | 5 | 4 | 3 | 6 | 9 | 2 |
Test 9 | 50 | 13 | 42 | 32 | 37 | 23 |
Test 10 | 9 | 9 | 5 | 16 | 16 | 11 |
Test 11 | 29 | 34 | 20 | 44 | 21 | 22 |
Test 12 | 0 | 2 | 3 | 2 | 1 | 1 |
Total | 262 | 275 | 532 | 357 | 268 | 349 |
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!
#1 by frank on March 30th, 2011 ·
unbelievable
#2 by AlexG on June 9th, 2011 ·
I though JS is at least 100% faster then AS3.0 because Processing (http://processing.org/) looks much faster than AS3.0 and Processing is based on JS. Did you try to test Processing performance? I dont work in Processing but it is a very interesting THING
#3 by jackson on June 9th, 2011 ·
JavaScript performance highly depends on the browser. At most, JavaScript is performing moderately better than AS3, but nowhere near a 2x speedup.
As for Processing, the project is indeed quite impressive. That said, it doesn’t look to me like they have an AS3 version. As such, it would make for a poor testing suite when comparing AS3 to JavaScript.
#4 by Liam Walsh on July 22nd, 2011 ·
Processing is based on Java – not Javascript.
It is indeed faster than AS3 but it’s a different runtime entirely.
Processing can now export to js – but will be slower than as3.
Haxe exports to both but has best performance exporting to the swf runtime (as3)
Liam
#5 by devu on November 16th, 2011 ·
I did covered some testing regarding to AS3 and JS but also focusing on the mobile environment. Please run my test and I am trying to collect some data. Test app will save it automatically into the data base so I can publish and cover many different platforms. AS JS is catching up AS3 these days, on mobile devices is completely different story and the whole hype HTML5 for mobile devices doesn’t make any sense yet. But I am trying to find out more about it.
http://flaemo.com/blog/?p=353
Best!