Collections are also often backed by arrays or linked list (which
implies extra objects) so the overhead can be significant over an
array. If you need a growing array though, you might want to stick
with collections. android.view.ViewGroup uses its own growing array
implementation to avoid the extra cost of ArrayList for instance.

On Tue, Feb 3, 2009 at 5:48 PM, David Turner <[email protected]> wrote:
> if you need to access them in a tight loop, arrays are much faster than
> collections
> (because accessing an array element is very fast compared to calling an
> interface method to get at the corresponding item in a collection)
>
> On Wed, Feb 4, 2009 at 2:37 AM, gsmd <[email protected]> wrote:
>>
>> The 'Writing Efficient Android Code' paper doesn't mention this: are
>> arrays preferred over Collections in terms of performance? To what
>> extend?
>> TIA.
>>
>
>
> >
>



-- 
Romain Guy
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to