AS3 Performance comparison tool

I ran across an interesting performance comparison tool at businessintelligence.me

This could be very useful for code optimization and for a general understanding of what’s going on behind the scenes.

performace comparison tool

Perhaps the most striking comparisons in this tool are the ones that compare Vectors to Arrays. Looping Vectors appears to be about 60x faster than looping through Arrays. Someone recently asked me when you would want to use Vectors and my response was whenever you possibly can. And if you think about it, the times which you need an untyped Array are (should be) almost never.

About Mims H Wright

http://dispatchevent.org/wp-content/avatars/animemims.gif
This entry was posted in AS3, Site-seeing. Bookmark the permalink.

5 Responses to AS3 Performance comparison tool

  1. Matthew says:

    Awesome find sir, passed it along.

  2. Micheal Draw says:

    Hi.
    Test is good.this graphics drawing referenced speed?

  3. John Brown says:

    I did not know that about Vectors. I didn’t even know what a Vector was. Now, I will be including that in my workflow.

    Thanks so much!

  4. SP says:

    Array is THAT much slower than Vector because it should be casted.
    var num:int = int(array[i]);

    Vector is faster than Array, but not THAT much.

    SP.

  5. Michael D. says:

    I am the author of the EventListenerManager -ELM.
    I created a benchmark to measure other EventListenerManagers out there and ELM of course for comparison – however I had two versions, one using Vectors, another one using Arrays. In this benchmark using Vectors were saving some KBs of Memory but the Array was still faster. No need to cast Vector elements which I did in this test for Array elements – results might turn out different without the Array-element-casting. I prefer FP9 compatibility over not so much better FP10 only Vectors…)
    You might checkout the benchmark and it’s source to play with it – http://code.google.com/p/as3listenermanager/

    cheers
    mike

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>