• 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: literal strings - who do they belong to?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: literal strings - who do they belong to?


  • Subject: Re: literal strings - who do they belong to?
  • From: Wade Tregaskis <email@hidden>
  • Date: Mon, 13 Jul 2009 18:07:44 -0700

There's also a high cost, in CPU cycles and memory, to retain/ [auto]release in such an excessively defensive way. And have fun using Object Alloc to find real problems once you've added these superfluous retain/release/autoreleases to every return value in your entire program.

But wouldn't adding those retain/autoreleases to every accessor in your entire program have the same effect?

Perhaps to an extent, if the object in question lives a long time relative to the number of gets of it. But in any case, the same object may be passed down a very long callstack, so the difference could be between a single retain]autorelease] and a thousand of them.


It's still easier to interpret in tools like Object Alloc, though - you can clearly see the retain]autorelease] for each getter scattered throughout other uses. The periods you're most interested in are likely to be between calls to the getter (on the same thread, at least), and so much less noisy.

Wade
_______________________________________________

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


References: 
 >literal strings - who do they belong to? (From: William Squires <email@hidden>)
 >Re: literal strings - who do they belong to? (From: Bill Bumgarner <email@hidden>)
 >Re: literal strings - who do they belong to? (From: Peter N Lewis <email@hidden>)
 >Re: literal strings - who do they belong to? (From: Wade Tregaskis <email@hidden>)
 >RE: literal strings - who do they belong to? (From: Jeff Laing <email@hidden>)
 >Re: literal strings - who do they belong to? (From: Charles Srstka <email@hidden>)
 >RE: literal strings - who do they belong to? (From: Jeff Laing <email@hidden>)
 >Re: literal strings - who do they belong to? (From: Wade Tregaskis <email@hidden>)
 >Re: literal strings - who do they belong to? (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: literal strings - who do they belong to?
  • Next by Date: Re: [iPhone] Network connection between 2 iPhones
  • Previous by thread: Re: literal strings - who do they belong to?
  • Next by thread: Re: literal strings - who do they belong to?
  • Index(es):
    • Date
    • Thread