More Performance Notes
20 August 2013
Tags
- Fairy Tale Twist
- Performance
- Starling
More potential optimizations in Starling and the game:
- Optimize memory for interpolate matrices
- Review using try/catch in inner loops/leaf functions, use return values as try/catch allocate memory
- Starlings VertexData is a large consumer, specifically scaleAlpha, applyTo and getOffset. Consider unrolling loop in copyTo and inlining getOffset
- EventDispatcher.hasEventListener is a large consumer, consider a mapOfBools rather than extracting and determining the length of a vector
- DisplayObjectContainer.render, consider moving setting the blend mode into children upon which they are affected
- Garbage Collection is 17th highest consumer, consider removing instances of new Type. Where Type is: Matrix (15,000 instances, 17% of total allocations), Array (11000, 13%), String (8000, 10%), Rectangle (8000, 9%), Vector (7000, 8%) and Point (4000,4%)
- Calls to intersects allocates a return Rectangle, consider unrolling and inlining