How Big Is That Class?

Tags: , , , , , , , ,

When you instantiate one of your classes, how much memory does it use? Today’s article tries out a lot of combinations and counts the bytes used. The conclusion is easy to remember and will give you a solid understanding of how much memory your app is using.

Read the rest of this article »

5 Comments

The Goto Keyword

AS3 has a controversial new keyword: goto. It’s not documented, but this article will tell you how it works. It’ll also talk about why you might want to use it to improve performance or even make your code more readable (gasp!).

Read the rest of this article »

1 Comment

The Cost of If-Else

Tags: , ,

The if-else keyword is not free. So, how expensive is it? Today’s article finds out.

Read the rest of this article »

5 Comments

Bytecode Analysis: Why do-while Is so Slow

Tags: , , , ,

The do-while loop is slower than the for and while loops… at least in Flash. Why? Today’s article digs into the bytecode the compiler generates for a variety of these loops to find out why.

Read the rest of this article »

10 Comments

Saving Memory with BitmapData Tricks

Tags: , , , , ,

Last week’s article showed a variety of tricks for saving memory with ByteArray. Today’s article explores some tricks to use with BitmapData to save even more memory.

Read the rest of this article »

2 Comments

ByteArray Secrets

Tags: , , , ,

The ByteArray class is not as straightforward as you might think. In certain situations, it has surprising, undocumented functionality. Today’s article goes into some of these strange behaviors so you’ll get a better handle on exactly what’s going on behind the scenes.

Read the rest of this article »

6 Comments

Optimize Algorithms and Data Structures First

Tags: , , , ,

Today’s article is both a reminder to optimize your algorithms and data structures before your code and a demonstration of the payoff you’ll get by doing so. By choosing the most effective algorithm and data structure to solve your problem you’ll reap huge rewards in performance. A 10x, 100x, or even bigger boost is easily attainable.

Read the rest of this article »

No Comments

Four Ways to Clean Master Strings

Tags: , , , ,

When I first wrote about master strings I proposed a function that would help to trim them down and potentially save a lot of memory. However, that method still resulted in a string with a master string one longer than it. Ideally, we’d have no master string at all. Since then, three astute readers chimed in with alternate solutions to the problem. Today I put try all three out to see which method does the best job of cleaning master strings.

Read the rest of this article »

6 Comments

Recursion vs. Iteration

Tags: , , ,

Function calls in Flash are notoriously slow. Recursive algorithms require lots of function calls by definition. So are iterative versions faster? Today’s article explores whether or not it’s worth converting your recursive algorithm into an iterative one.

Read the rest of this article »

10 Comments

Int Keys: Object vs. Dictionary vs. Array vs. Vector

Tags: , , , , , , , ,

Given that Object and Dictionary can have int keys and that int keys are faster than String keys, a natural performance test follows: which class is fastest at reading from and writing to those int keys? Is there a difference between the four Vector classes? Today’s article performs just that test and comes up with the answers.

Read the rest of this article »

8 Comments