Flash 5 ActionScript Speed Measured

There you'll find a test I've have done measuring the speed of Macromedia Flash 5's plugin running different types of syntax. All the tests were done using Flash Movies themselves.

Besides a text with the test results and methods, you'll also find the original tests available if you want to run them, as well as downloadable source files.

So here it is: Variables and Properties Control test. it tests the speed of commands calling and setting variables and properties inside objects (grandchild, child, local, parent, grandparent). Tests include:

  • slash-syntax referenced variable vs dot-syntax referenced variable
  • telltarget vs object.method
  • getProperty vs object.property
  • setProperty vs object.property

 

Notes

If you're coding your everyday's job, you don't have to pay attention to these tests, since they'll make no difference on "normal" movies. As you can guess, 60000 executions of some commands could have delayed the movies I tested bit, but if you're running just a few commands, it'll make no difference.

I would like to emphasize that coding using the "new" syntax is much better; it's not only better to write and read, but also better to understand and learn, and it agrees with standars stablished with so many other object-oriented languages like Java and C.

I have followed the demoscene for some years, and something I have learned by watching the wizards was to try and look on every bit of the code, trying to extract every milisecond out of code execution time. That included using whichever commands where available, no matter how ugly they were. I'm not telling it's good to do "old" or "deprecated" code; just that, in times of need, one can use certain commands and gain a little boost.

Little update (June 2003):

Overall, using Flash 4 syntax is a pain in the ass. This tests are not intended to prove Flash 4 syntax needs to be used. Far from that. Hell, I can't even used Flash 5 anymore now that I'm used to Flash MX, and I can barely remember how it was coding for Flash 4. I wouldn't suggest anyone using Flash 4 syntax. This tests are meant only to prove that there's some room for improvement on the Flash plugin. Since day one that I've uploaded this page, the purpose of it has been this: to show that the plugin i's slower than it should. Do a favor for yourself and don't take the test results literally.

These tests were done by zeh.