Categories Displayed in Flash

AS3 Performance relative to Java, Javascript, AS2

Good article. For most things Java was 3 times faster, but of course nobody really writes for Java applets. Javascript versus Flash is tricker, and as one can see highly browser dependent...huge differences! I'm so glad I'm not working directly on DHTML apps.
http://www.oddhammer.com/actionscriptperformance/set4/

Working in flash is a bit like a cake on a platter. The cake (your swf) can come in all sorts of flavors that you as a cook can make, and is flexible in shapes, but when hitting the platter (the flash player) you lose this customizability, it's there to allow your cake to stand.

When dealing with actionscript, some code is the icing (your classes), some the cake (flash's instrinsic classes), and some is the platter (functions that are actually natively implemented in C). Depending on how many layers of icing and cake one has to get to before hitting platter, can make orders of magnitude difference. The fastest interpretted actionscript is always slower than the native function calls, as in the end everything has to get boiled down to simpler native calls.
There are many features in flash implemented 'natively' (event dispatching, e4X, binary data + AMF) and as such using them when possible over rolling your own classes, as it may be an order of magnitude faster. This is why it's good to spend time just reading through the packages to understand what is possible, prior to writing your own, as there are many portals into the underlying player substrate.

This has implications on architecting applications. Even if the algorithm in has been tweaked for hours, the 'cleanest' solution may ironically perfom worse, because you're only adding layers of cake and icing instead of going lower.. This often happens when porting proven projects from other languages, or keeping application frameworks in synch on a webserver and flash.

Add a Comment: