Implicit Conversion and Performance in Actionscript 3.0
I remember when I started messing with this Flash/AS3 business a while ago, I read about these “new” uint and int types that would supposedly perform better than the “Number” type. THEN I read a bunch of articles by “reputable” people posting about how the performance gains didn’t exist, and which gave seemingly random benchmarks on some tests run using them.
So I looked into it and, barring some crazy patching by Adobe since those original articles were written (over a year ago as of this posting), I’m left to believe that they were just plain wrong. I think that this was due to a misunderstanding of the implicit conversions that happen, even though the authors of these articles *seemed* to be aware of the issue. Who knows.
But here are my results:
UINT time: 90
INT time: 92
NUMBER time: 303
WOW, seems pretty much like what you would expect, huh? Isn’t that just CRAZY?