Above all others, there is one article I refer back to most: 2009’s Function Performance. It was updated for Flash Player 10.1 and 10.2, but not 10.3, 11.0, 11.1, or 11.2. Today I’m updating this article for Flash Player 11.2, adding some missing function types, and including a set of graphs to make for the ultimate function performance reference.
Archive for category AS3
While my three part series on draw calls in Stage3D
urged you to reduce them as low as possible, it didn’t give you much in the way of techniques for avoiding them. Sure, it had some good ideas for combining 2D sprite draws into a single draw, but how about 3D? Today’s article tackles the concept of “view frustum culling” to provide an automatic speedup to virtually any 3D app utilizing Stage3D
.
To draw with Flash Player 11’s Stage3D
API, you must set up the state of various GPU resources before finally calling drawTriangles
. Inevitably, you’ll end up calling drawTriangles
multiple times during a single frame to draw your characters, terrain, sky, and so forth. In between these calls you will change the GPU’s state by calling Context3D
‘s set*
functions. This article will show you which of these functions can literally cut your app’s performance in half.
When a recent comment asked about string concatenation performance, I realized that there are a lot of ways to build strings in AS3 and I hadn’t tested any of them. Leaving aside the sillier ones like the XML class or joining Array
objects, we have two serious contenders: the lowly +
operator (i.e. str + str
) and the ByteArray
class. Which will triumph as the ultimate way to build strings quickly?
Which is the fastest way to store data: Vector
or ByteArray
? Given that you can upload both types to Stage3D
in Flash Player 11, this question has never been more relevant. So which should you use to maximize your app’s speed? Read on for the performance testing.
The const
and final
keywords only apply at compile time. Despite having written about const and final before, readers frequently ask me about these two keywords. Today’s article will answer the question and definitively show that these keywords only apply at compile time: not runtime. UPDATE: const
is still just a variable as far as performance goes, but its protections do extend to runtime.
The site has had many articles about improving the performance of your app, but never discussed the basic methodology on which all optimizations should be based. Today’s article will go over a scientific approach to optimizing that makes use of a tool known as a profiler and demonstrate using an AS3 application just why it’s so important to usage such a tool.
So far we’ve seen how to use Stage3D
to get massively increase performance with hardware acceleration, but that performance has come at a cost: we must use the same texture for each object we’re drawing. Today we’ll smash that requirement without losing an ounce of performance!
Today’s article shows you how to get great performance with a ton of sprites by reducing your Stage3D
draw calls. As we saw last time, Stage3D
performance is not guaranteed to be good and falls significantly below normal 2D Stage
performance even on expensive tasks like scaling and rotating Bitmap
objects as well as redraw regions covering the whole stage. Today we’ll show how to overcome those performance problems and beat the tar out of the 2D Stage
.
There’s no doubt that Flash 11’s new Stage3D
API can produce some amazing results by giving us access to the power of the user’s video card/GPU. However, it’d be a mistake to blindly assume that it is always faster than the traditional Flash display list (i.e. Stage
). Today’s article begins a series that discusses the topic of “draw calls” and how they heavily impact the performance of your application.