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.
Posts Tagged int
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.
Pop quiz: what’s the difference between an
Object and a
Dictionary? If you said “
Dictionary can have non-
String keys”, you bought into a common myth. Today’s article shows the cases where the lowly
Object class will use non-
String keys whether you like it or not. Read on for the details.
In last week’s primer on the new domain memory (“Alchemy”) opcodes the initial test showed that they couldn’t match the performance of good old
Vector when writing out a lot of float/
Number values. Today’s article expands on that test to check the performance of writing integers and the performance of reading integers and float/
Number values. Can the domain memory opcodes redeem themselves? Read on to find out.
Strings and integers sort differently. Unfortunately, this became a problem for me during some recent experiments with Starling. It could be a problem for you too in a variety of situations. Today we’ll look at a workaround I’ve developed to solve this problem, which isn’t nearly as straightforward as you might think.
Behind the scenes
Array holds its values in two ways: a densely-packed array at the beginning and a sparsely-packed map after that. This means it can be used as a map where the keys are indexes and not take up a huge amount of wasted space.
Dictionary can also have
int keys. Which is faster? Today we’ll find out!
This is an extremely common task: converting a
Number to an
int. There are a lot of ways to do it, but which is fastest in AS3? Today we’ll look at a performance test app that attempts to find the fastest way to accomplish this. The answer just may surprise you!
Math.abs is a commonly-used utility function for taking the absolute value of a
Number. However, there’s no special-case version for taking the absolute value of an
int. Of course
Math.abs will work for
int values, but we can do it faster. Read on for a couple of ways.