Updated benchmarks: Flash 10 Release Player
February 7th, 2010
Since I had my benchmark code already warmed up from Friday and a photoshop doc open with my histograms, I figured I should make good on the updated speed tests that I promised a year ago.
Here is basic math, receiving a huge boost between debug and release modes. The shaded bar is the duration of the call, so shorter means faster execution.

From here down, everything is running 10m iterations. The scale of these graphs is 560ms. Here's the difference in calling a static public variable, versus a local copy of same.

Finally, replacing the Math helper methods with some logic and basic math:








These stack up pretty well with what I saw in the debug player a year ago (although there is an overall speed increase in all the tests).
If anyone is curious, there is a slowdown in calculating powers of a number (i * i * i * i) as you have to reference that variable over and over - for me the break-even between stringing on more 'i's and just calling Math.pow() was around 60.

February 21st, 2010 at 2:20 pm
How do you do your speed tests?
Know how to test the speed would be most beneficial for me.
Anyway, I really like your blog,
Thanks
February 23rd, 2010 at 8:11 pm
[...] Math Class February 24, 2010 Posted by Cherie in AS3. trackback Updated Benchmarks http://www.calypso88.com/?p=539 [...]
May 12th, 2010 at 7:28 am
@Nick – I used to use an in-Flash block of code to run my tests until I started hearing all the fuss about debug vs. release player performance. Since the difference in calls is usually comparable between the two players, I keep the old code around for quick tests while I’m working. For example, Point.add is way slower than Point.offset. In debug it’s about 5:1, in release its closer to 12:1. For daily development, that fast comparison is enough to go on until it’s time to really fine tune a project. Here’s that code:
http://www.calypso88.com/?page_id=160
When I finally had free time to do some more benchmarks, I rewrote that code to work in the release player. So when I’m ready to do “real” benchmarking, I load up the code below in a blank fla, add a name for the test, and publish it out to the browser (where I’ve uninstalled the debug player and installed the normal one). This version of the code stores a running average of the test (indexed by the test name at the top) in a local shared object so you can just hit refresh over and over to get more exact results on the same code.
http://www.calypso88.com/?page_id=556