“Andy, Andy,” a man shouts excitedly. “I love your blog post on improving mobile performance with AS3!”
Andy has heard this phrase dozens of times now, having just attended a GDC full of flash and mobile development friends. “Thank you, fine sir. I hope it worked out well for you.”
“Well…” He stammers for a few seconds, and tugs on his collar in an absent-minded fashion. “I’m not seeing the performance increase of astounding amounts. It might be a little faster… I just can’t figure it out. It’s a simple game, and it gets quite low FPS!”
Andy has heard this complaint before, and is immediately skeptical, but maintains his composure. He asks the standard battery of questions – did they do the bitmap caching properly, do they have a proper static variable in the wrapper class, but they never seem to lead to a solution. Everything seems fine. That is, until Andy asks the fateful question: “Are you displaying the Bitmaps wrapped in a Sprite, as I suggested in the article?”
“Oh, I don’t need to,” he responds. “I’m using flixel.”
It really is a sight to see; watching somebody calmly grab the edge of a table, and in one quick motion flipping it over. The world seems to enter bullet-time; the salt shaker spinning through the air, the table completing two full rotations before first touching down on the ground. As Andy rises from his chair – face bright red in anger, veins bulging from his incredibly muscular neck – he looks to the sky. With arms outstretched, a primal roar escapes his lips.
Andy then sits back down, corrects his table, and instructs this fellow developer to read the whole article, particularly the bit at the end that says that blitting (and by extension, all blitting engines, such as Flixel and Flashpunk) circumvent the performance enhancements. Andy then recovers the salt shaker, and calmly explains how the start of the article also mentions the use of flash’s standard display list.
The man finally realizes his folly. Flash does not* have access to the powerful GPU on desktop computers, and blitting is a way to more efficiently use the CPU to render things. On mobile devices, flash DOES have access to the GPU, and automatically does a blitting-equivalent of the display list. Telling flash to use blitting manually (by using Flixel/Flashpunk) is telling it to NOT use the GPU, but the CPU instead, hobbling perfromance. He then gives Andy a million dollars.
*stage3d not counted