• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa et al as HCI usability problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa et al as HCI usability problem


  • Subject: Re: Cocoa et al as HCI usability problem
  • From: "Adam R. Maxwell" <email@hidden>
  • Date: Fri, 23 May 2008 21:39:59 -0700


On May 23, 2008, at 9:19 PM, Graham Cox wrote:


On 24 May 2008, at 7:34 am, Bill Bumgarner wrote:

The NSEnumerator stuff is prone to introducing silly errors, is inefficient, and not very pleasant to look at.

Can you go into more detail about the efficiency improvements? I do use a lot of NSEnumeration-based code and this *could* convince me to use Obj-C 2.0 enumeration (though at present I'm still rather keen to support Tiger). What sort of gains are we looking at? twice as fast? ten times? Or 1.1 times?

I did some crude benchmarking a while back and found that NSFastEnumeration was roughly the same as using CFArrayGetValueAtIndex() in a loop, and both were faster than using NSEnumerator or -[NSArray objectAtIndex:].


The significance of this depends on your situation, of course. In an app that enumerates thousands of small collections while parsing a file, dumping NSEnumerator in favor of CF functions was a big win in terms of time and memory profiles in Shark, mainly because of the overhead associated with creating/using/destroying lots of enumerators. NSEnumerator also sends retain/autorelease to the last object of its collection, so it can cause a pool to fill up if you're not careful.

Here's an interesting graph, although a bit dated now:

http://www.mulle-kybernetik.com/forum/Optimization/viewtopic.php?t=27&sid=a6c5e357369c081eb672a8f604cdda98

This article has comparisons of Obj-C and CF overhead:

http://www.mulle-kybernetik.com/artikel/Optimization/opti-3-imp-deluxe.html

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Cocoa et al as HCI usability problem
      • From: Bill Bumgarner <email@hidden>
References: 
 >Re: Cocoa et al as HCI usability problem (From: Jeff LaMarche <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: Andy Lee <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: Jeff LaMarche <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: Andy Lee <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: "Sherm Pendley" <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: Andy Lee <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: Graham Cox <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: Ilan Volow <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: GĂ©rard Iglesias <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: "Sherm Pendley" <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: glenn andreas <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: Bill Bumgarner <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: File's Owner
  • Next by Date: Re: Removing the Filename flag in Doc. based Application
  • Previous by thread: Re: Cocoa et al as HCI usability problem
  • Next by thread: Re: Cocoa et al as HCI usability problem
  • Index(es):
    • Date
    • Thread