We’ve seen that
if-else trees are way faster than
Dictionary, and even
switch at key-value mapping, but how do they stack up against
Vector? Today’s article puts them to the test and uncovers some unexpected results.
Posts Tagged vector
We’ve seen that
Programming in AS3 invariably involves choosing between various collections:
ByteArray, and so on. What if you need to quickly copy between them? Your choice of collection could result in a 450x slowdown in your app… or a 450x speedup!
AS3 has three kinds of loops—
for-each—but which is fastest? I attempted to answer that question about three years ago, but the article is in dire need of a followup as many version of Flash Player have been released since then and the question is core to our everyday lives as AS3 programmers. So which type of loop is fastest in 2012?
It’s been a while since I’ve posted a utility function, but today I’m breaking the streak and posting a couple of related functions I frequently find useful in debugging:
joinNLabeled. These functions are like
Vector.join, but they group elements of the array to make the resulting string much easier to read.
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.
Thanks to Tronster for today’s guest article! If you’re interested in writing a guest article, e-mail Jackson about your idea.
Natively, Flash does not offer a two-dimensional array type. But, Flash’s one-dimensional
Array and various other container types (i.e.,
Vector) allow for user-created 2D array solutions. Today’s article explores the performance of various ways to make a 2D array.
Today’s article is about an unintuitive-yet-simple optimization you can use to hugely increase the speed of reading from
dynamic classes. Need I say more? Read on for this amazing speedup!
During some recent memory profiling I was reacquainted with just how many ways there are to unknowingly allocate an object in AS3. The problem is seldom the allocation itself, but rather the later garbage collection (GC) to delete those objects. Ever used a Flash profiler only to see a huge chunk of your CPU time going to
[sweep]? Yeah, that’s the GC at work. Today’s article talks about some of the ways you end up allocating objects in AS3 without using the
new keyword. These subtle errors can end up costing you!
Vector3D class debuted in Flash Player 10.0 as Adobe’s official implementation of, well, a 3D mathematical vector (not the pseudo-
Vector). Weirdly, it has a
w component and is therefore technically a 4D vector, but its API inconsistently make use of the fourth dimension. There are also strange oversights, inefficiencies, and functionality it really should have always had. Read on for my custom
Vector3DExt—that fixes all of these problems by extending and improving on the original.