It is currently Thu Mar 28, 2024 7:37 pm

Mulle kybernetiK Optimization

Forum for Optimizations around Cocoa and Mac OS X

NSArray - enumerator vs. loop

Optimizations concerning <i>Foundation</i> or <i>Objective-C</i> and its runtime
User avatar
 
Posts: 42
Joined: Fri Aug 06, 2004 9:20 am
Location: Bochum
Website: http://www.mulle-kybernetik.com/weblog

NSArray - enumerator vs. loop

Post by Nat! » Fri Sep 24, 2004 1:07 am

Image
Image

The brown line is enumeration with <tt>-[NSEnumerator nextObject]</tt>
The purple line is iteration with <tt>-[NSArray objectAtIndex:]</tt>

 
Posts: 5
Joined: Tue Sep 07, 2004 4:50 am

Post by whitenoise » Fri Sep 24, 2004 11:27 pm

What's the disparity between the two charts?

User avatar
 
Posts: 42
Joined: Fri Aug 06, 2004 9:20 am
Location: Bochum
Website: http://www.mulle-kybernetik.com/weblog

Post by Nat! » Sat Sep 25, 2004 1:38 am

whitenoise wrote:What's the disparity between the two charts?


It's just a matter of scale. The top chart, has a vertical range from ca. 0 to 2000 ns and the lower chart has a y scale from 20 to 70. That way some differences, that you don't see in the top chart are revealed. Sorta like a zoom into an interesting portion.


Return to “Foundation & Objective-C”

Who is online

Users browsing this forum: No registered users and 1 guest