• 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: Creating strings in a loop - Efficiency Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating strings in a loop - Efficiency Question


  • Subject: Re: Creating strings in a loop - Efficiency Question
  • From: Dave Carrigan <email@hidden>
  • Date: Thu, 28 May 2009 09:27:58 -0700


On May 28, 2009, at 9:20 AM, Reza Farhad wrote:

I have a situation where I need to create a new string as I go through a loop.
What will be the most efficient way of doing this each time the call goes through the loop.


1. To create an auto releasing string.
2. To create a non auto-releasing string at the start of the loop and releasing it at the end of the loop.
3. To create a non auto-releasing mutable string before the loop and then at the start of the loop delete and reset it content to a new value. And obviously delete the string after the loop.


4. An alternative suggestion!!!!


5. Pick the easiest one of these, and then wait until you start profiling your application to decide if this even needs to be optimized.

--
Dave Carrigan
email@hidden
Seattle, WA, USA

Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________

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: 
 >Creating strings in a loop - Efficiency Question (From: Reza Farhad <email@hidden>)

  • Prev by Date: Creating strings in a loop - Efficiency Question
  • Next by Date: Re: performSelectorOnMainThread problem
  • Previous by thread: Creating strings in a loop - Efficiency Question
  • Next by thread: Re: Creating strings in a loop - Efficiency Question
  • Index(es):
    • Date
    • Thread