Can anybody say me what is faster: Array or ArrayList? (ActionScript3)
I tried to find a page about this but didn’t find anything.
Thank you.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As already stated, Array is faster. Actually it is orders of magnitude faster.
The equivalents of array access are
getItemAtandsetItemAt.Implementation:
and:
There’s a LOT of calls and checks involved here. Please note, that
_dispatchEvents == 0istrueby default (unless youdisableEvents), thus writing in fact is an immense operation.However
ArrayListdoes provide a lot of feature, that are usefull within flex. A good compormise is to grab the underlyingArray(accessible asArrayList::source), peform your operations, and then reassign it (supposing you have listeners observing that Array).Also, if you go with Flash Player 10, then Vector will outperform Array.
greetz
back2dos