Re: [__NSFastEnumerationEnumerator nextObject] unexpectedly not very fast!

2009-09-25 Thread Charles Srstka
On Sep 25, 2009, at 12:38 PM, Ben Trumbull wrote: In summary, the existence of fast enumeration does nothing for existing enumeration technologies and if you have to support 10.4 (as I do) you simply can't use it unless you fork your code. My solution, in the few cases where performance is para

re: Re: [__NSFastEnumerationEnumerator nextObject] unexpectedly not very fast!

2009-09-25 Thread Ben Trumbull
In summary, the existence of fast enumeration does nothing for existing enumeration technologies and if you have to support 10.4 (as I do) you simply can't use it unless you fork your code. My solution, in the few cases where performance is paramount, has been to essentially roll my own fast enum

Re: [__NSFastEnumerationEnumerator nextObject] unexpectedly not very fast!

2009-09-25 Thread James Bucanek
Graham Cox wrote (Thursday, September 24, 2009 6:10 PM +1000): I thought that NSEnumerator was implemented in terms of fast enumeration "underneath" - the docs seem to imply that, as does the existence of __NSFastEnumerationEnumerator private class. It may be still

Re: [__NSFastEnumerationEnumerator nextObject] unexpectedly not very fast!

2009-09-23 Thread Jens Alfke
On Sep 23, 2009, at 6:10 PM, Graham Cox wrote: I thought that NSEnumerator was implemented in terms of fast enumeration "underneath" - the docs seem to imply that, as does the existence of __NSFastEnumerationEnumerator private class. It may be still slower than directly using the fast enum

Re: [__NSFastEnumerationEnumerator nextObject] unexpectedly not very fast!

2009-09-23 Thread Graham Cox
On 24/09/2009, at 9:15 AM, Jens Alfke wrote: On Sep 23, 2009, at 2:27 PM, Matt Gough wrote: NSEnumerator *iter = [myMutableArray objectEnumerator]; while (syncInfo = [iter nextObject]) { ... Do some stuff } That's not a fast enumerator; that's the ol

Re: [__NSFastEnumerationEnumerator nextObject] unexpectedly not very fast!

2009-09-23 Thread Jens Alfke
On Sep 23, 2009, at 2:27 PM, Matt Gough wrote: NSEnumerator *iter = [myMutableArray objectEnumerator]; while (syncInfo = [iter nextObject]) { ... Do some stuff } That's not a fast enumerator; that's the old-fashioned slow enumerator. (Although as alr

Re: [__NSFastEnumerationEnumerator nextObject] unexpectedly not very fast!

2009-09-23 Thread Greg Parker
On Sep 23, 2009, at 2:27 PM, Matt Gough wrote: I have an NSEnumerator iterating over an NSMutableArray like so: NSEnumerator *iter = [myMutableArray objectEnumerator]; while (syncInfo = [iter nextObject]) { ... Do some stuff } Upon instrumenting it, I no

[__NSFastEnumerationEnumerator nextObject] unexpectedly not very fast!

2009-09-23 Thread Matt Gough
I have an NSEnumerator iterating over an NSMutableArray like so: NSEnumerator *iter = [myMutableArray objectEnumerator]; while (syncInfo = [iter nextObject]) { ... Do some stuff } Upon instrumenting it, I noticed that nextObject was taking over 60% of t