Some parts sounds somehow strange, like the recommendation to avoid Event Dispatching as for every event an object has to be created. On the other hand they recommend object pooling for reusing objects. So the question pops up, why the native Event Dispatching is not implemented in the way that it benefits from a native object pooling? When performance optimization is leading to bad coding practice, something in the technology seems to be wrong. The poor method execution performance in Flash is one of these issues.
Here just a few random issues discussed in the paper:
- Setting not used objects explicitely to null helps the garbage collector
- Call dispose() on the BitmapData object when not used anymore
- When using Filters 2 Bitmaps are created and kept in memory. Applying a filter is CPU intense, so try to use pre-rendered Bitmaps instead.
- Deactivate interactive objects when no Mouse interaction is needed (mouseEnabled, mouseChildren)
All in all it is good to see that Adobe is aware of the performance problems and hopefully will push the Flash Player forward using the optimization headroom available at the compiler level and the Flash Player itself. Maybe the current effort to make Flash “ready for mobile” will give us the same performance boost like with AS3 that was primarily introduced because of the greed of Flex which simply didn´t perform on the AVM1.