I saw a question about performance tests today, and so I looked around a found a nice set of performance tests by Mike Lyda. Performance numbers comparing Javascript and Flash Player 7/8/8.5 can be found here.
Curious to see the latest numbers, I updated the MXML tests for the latest version of Flex and Flash Player 9. You can get the updated source and SWFs here.
I'll leave the posting of a complete set of performance numbers for someone else. A few of my impressions:
Based on the relative speed of the Javascript tests, all but one (test 8) of the tests run faster than the Flash Player 8.5 (the beta for Player 9) numbers posted in October 2005.
Initial string concating is much faster than in the 8.5 numbers. (Alternatively, string interning doesn't give as much improvement.) The first half of test 3 and 4 are only twice as slow as the second half.
The harmonic, substring, and empty-for-loop tests (5, 6, 9) are blazingly fast now. 5ms, 10ms, and 60ms on my machine.
Lastly, I'll describe the changes made to the tests. The namespace in each MXML page was updated. Types were added to all variables, which should make the tests faster and clear up the warnings. Other simple warnings were cleared. The MD5 source was downloaded from the suggested site and quickly converted to AS3.
Update: The source and SWFs have been updated with a working test 10 from Mike. I've also updated the tests to clean up the MXML and remove the many warnings from MD5.as. Mike has also told me that he plans to update his page with the new results, and I'll update this page with a link when that happens.
Update 2: Mike has updated the numbers.
Update 3: Mike has updated the chart again, showing Java applets as well as the numbers for the latest version of Flash.
Comments (7)
awesome! I've been wanting to do this, but have been too covered up, so it's great to see someone carried the torch (and fixed my AS3 noob errors). :)
Posted by mike | July 3, 2006 11:47 PM
Posted on July 3, 2006 23:47
"The harmonic, substring, and empty-for-loop tests (5, 6, 9) are blazingly fast now. 5ms, 10ms, and 60ms on my machine."
I hope that is 60ms for Flash 5, 10ms for 6, and 5ms for 9...?
Posted by Bill | July 12, 2006 2:17 PM
Posted on July 12, 2006 14:17
Nope- I meant for instance that harmonic is test 5 in the zip file and it took 5 ms. All of the numbers are just for AS3 and Flash Player 9.
Posted by Brian Deitte | July 12, 2006 2:29 PM
Posted on July 12, 2006 14:29
I know it's a while since the last post on this list. I think it's time to repeate the tests with the new gained JavaScript performance in Google chrome and Firefox ...
I am sure that there is also a performance gain on Flash' side.
Posted by Willi Burkhardt | October 15, 2009 9:08 AM
Posted on October 15, 2009 09:08
Willi, I think it'd be very interesting to see updated numbers as well. I'm not volunteering to run them myself, but if someone else does, let me know!
Posted by Brian Deitte | October 15, 2009 5:15 PM
Posted on October 15, 2009 17:15
Brian, I've redone the tests with Javascript (IE7 and Firefox 3.5.1), Java, AS2 and AS3. I think my results are not in a state to be published yet.
My general conclusion is that JavaScript engnine(s) are on par with ActionScript. The general gain in speed is such that I think the tests need to be refined, like increasing iterations, to get meaningful results.
If you want to contact me by mail, I can send a spreadsheet.
Posted by Willi Burkhardt | October 28, 2009 4:15 AM
Posted on October 28, 2009 04:15
Thanks Willi. I was more interested in them to hear the general conclusions, and it's interesting to hear they're getting close to the same numbers. If you end up posting these anywhere, let me know and I'll link to them.
Posted by Brian Deitte | October 29, 2009 10:20 PM
Posted on October 29, 2009 22:20