ActionScript
I found the Computer Language Shootout on debian.org via Jim Rutherford and thought it was just too tempting.. just where does ActionScript fit in there? Hmm.. that's a question I've been wondering since AS3 was released to developers. I did a few tests comparing ActionScript3 and JavaScript and found that AS3 had closed the performance gap finally... but just how does AS3 compare to Fortran?
So I picked the "binary-trees" test to find out.. I've only tinkered with AS3 (I won't be able to use it for production for probably a year) so I've still got a couple of warnings showing up when it compiles, but the results are very promising.
Here are the results for Flash Player 9/ActionScript 3/Flex2 I saw on my old AMD 2Ghz Athlon Win XP system.. It looks like the system they're using, "a single-processor 2.2Ghz AMD™ Sempron™ machine with 512 MB of RAM", is fairly close to what I'm using.. so we're in the ballpark.
And here's where ActionScript3 would fit into the benchmark table for this test..

Now.. as you can see it takes roughly 39 seconds on my system to run this test.. that's not blazing at all when compared to
Clean at 1.73 seconds (on their system). ... but.. Ruby came in at 352 seconds.
Here's the SWF that I made if anyone cares to try it.. (requires Flash Player 9).
And the code.. in case someone wants to fix my errors (yep.. I'm a AS3 rookie..). Ideally I'd run their tests on my system or have them run my test SWF on their system.
There's a critical upgrade for the Flash Player that was released today, so you need to get the latest version (8.0.24.0) from
the Flash Player Download Center.
It looks like this also affects Breeze users and the Shockwave Player.. ..and.. it looks like if you're stuck using Flash Player 7 for some reason then you get an update too! Hurrah! So go get version
7r63 or 7.0.63.0 of the Flash Player. Flex 1.5 is also affected..
Read all about the upgrade and the vulnerabilities at the security zone page about.. ..it.. .
Also, you might consider signing up for the
e-mail notification service that will alert you whenever there's a security issue found with Macromedia products (I'd point you to the
Adobe page for this, but it only lists Adobe products at this point.. the acquisition is still young..)
Hey.. and for you Flash developers or designers out there.. there's a tiny gotcha in this update apparently. I'm reading
the release notes to see what else changed and noticed this:
"This update introduces additional version checking to the installation process.... Flash and Flex developers may need to make slight modifications to their normal methods of switching between player versions during testing to account for this change"
And there's
a technote on that little issue of course..
So I installed Flexbuilder and the Flash Player 8.5 last night and went through the quickstart PDF and trying a few tutorials. It’s been a loooong time since I worked with MXML/Flex and it’s definitely going to take some work to get up to speed on it.
Anyway, so after hunting around some I found how to add some old style ActionScript to my “app” and have it reference a text field. It wasn’t hard to do mind you, just didn’t see any examples in the quickstart guide so had to dig a bit further.
So I wanted to see if the “performance tricks” that I’ve been collecting still apply to the new Player/VM. I only had time to try one.. Test #15 - string concatenating vs. Array join. Pulling up the old “Flash 8” SWF in the Flash Player 8.5 was no real change as expected.. but after I published the SWF from FlexBuilder the results are awesome.. the performance gain in the Flash Player 8.5 in working with Arrays looks to be huge. The String methods were also improved so the difference between concatenating the string or joining the array is fairly small (31ms vs 20ms) when compared to the FP7 days (830ms vs 109ms) seems relatively insignificant.
At any rate, this will prompt me to find some time over the next week or so to update my little performance tests. The original intent of my “actionscript performance tests” wasn’t to test one player vs. another, but to collect some of the tricks people used for performance gains. But naturally a performance trick in one Player doesn’t always work in the next version. So it’s going to be interesting to see what changed in 8.5. Also, if you know of new performance tricks that only work in FP8.5 please point me towards them..