• 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
Cocoa optimization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cocoa optimization


  • Subject: Cocoa optimization
  • From: David Hendrix <email@hidden>
  • Date: Wed, 9 Nov 2005 01:28:36 -0800

Everyone,

I've got an application where I'm seeing what looks like a great deal of overhead when compared to good old "plain C" code. For example, creating an NSString with [NSString stringWithFormat:...] seems to take something like 5-10 times longer than a malloc/sprintf combination. Of course some additional overhead is to be expected with a truly object-oriented language, but I'm surprised by the magnitude of the difference. I also wouldn't be worrying about it except that this particular application needs to do this (or similar) operations hundreds of thousands or millions of times.

This application relies on bindings, so at some point the data has to be turned in to something like an NSString, though I'm delaying that as long as possible by maintaining the (multi-megabyte) data as simple null-terminated strings until bindings actually ask for data it wants to display. (The data in this case is read-only, so I don't ever have to convert back.)

I really am not interested in starting a religious war, but am very much looking for tips and pointers on how to improve the speed of creation/conversion.

Any suggestions would be greatly appreciated.

 - Dave


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Cocoa optimization
      • From: j o a r <email@hidden>
  • Prev by Date: "Continuous Spell checking" feature to NSTextField?
  • Next by Date: Re: Cocoa optimization
  • Previous by thread: Re: "Continuous Spell checking" feature to NSTextField?
  • Next by thread: Re: Cocoa optimization
  • Index(es):
    • Date
    • Thread