The past few weeks I’ve been programming a scheduling component in Flash which has to be extremely performant. Every small adaption in my code that could help with limiting the processing needs is a good adaption. Today I stumbled upon a post of Grant Skinner in which he explains that using a uint is slower than a normal int. The uint’s can get five times slower than using a normal int.
So, what about the Number type? Well, I thought the Number type was a very slow type compared to the new int and uint but that also didn’t seem to be right!
Sho just posted a really interested article on why he won’t be using the int data type very frequently in ActionScript 3. Up until reading it, I had believed that as in other languages, there were large performance benefits to using ints and uints appropriately in AS3. Turns out that isn’t the case.
I did some quick testing on this, which confirm Sho’s assertion that int is only slightly faster than Number in ideal circumstances, but the results from uint were much more surprising.
Read the complete post here: gskinner.com
