Re: objectEnumerator vs objectAtIndex
Re: objectEnumerator vs objectAtIndex
- Subject: Re: objectEnumerator vs objectAtIndex
- From: Art Isbell <email@hidden>
- Date: Thu, 16 Feb 2006 12:11:08 -1000
On Feb 16, 2006, at 11:45 AM, Marcos Trejo Munguia wrote:
Today a question came to my mind, which method for accessing
NSArray elements is more efficient, objectEnumerator or objectAtIndex?
This is pretty easy to test yourself. Just iterate over a large
array (100,000 elements might be sufficient depending on the speed of
your computer) using both approaches printing the time before and
after the iterations.
With a particularly large array, I was concerned about this eons
ago. I found that using an Enumeration was somewhat slower, but for
smaller arrays, the difference was insignificant in the grand scheme
of things. But things may have changed now, so a quick test might be
worthwhile.
Aloha,
Art
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden