• 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: Garbage collector vs variable lifetime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Garbage collector vs variable lifetime


  • Subject: Re: Garbage collector vs variable lifetime
  • From: John Engelhart <email@hidden>
  • Date: Sun, 8 Jun 2008 20:39:41 -0400


On Jun 7, 2008, at 7:11 PM, Chris Hanson wrote:

On Jun 6, 2008, at 5:36 PM, Quincey Morris wrote:

A little inner voice insists on asking, though, how we know some future version of the compiler might not optimize '[data self]' upwards before the loop, if it decides that nothing inside the loop references anything non-local:

This won't happen because each message expression -- just as with function-call expressions -- is a sequence point. The compiler can't know what side-effects [data self] might have, so it can't re- order the invocation to elsewhere.


-- Chris

This is not necessarily true. If the const and pure GCC __attribute(())s were extended to objc methods then the compiler would be free to perform common subexpression and loop invariant code movement optimizations. The 'self' message would definitely fall under the domain of these attributes, thus the original argument is apropos. Considering the relative ease of extending this to objc methods and the possible performance gains, it's probably a given that this will happen eventually. Obvious candidates are immutable objects 'length', 'count', etc, which would result in a pretty big win if these attributes were available.
_______________________________________________


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: Garbage collector vs variable lifetime
      • From: Chris Hanson <email@hidden>
References: 
 >Garbage collector vs variable lifetime (From: Quincey Morris <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Bill Bumgarner <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Ricky Sharp <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Bill Bumgarner <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Quincey Morris <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Chris Hanson <email@hidden>)

  • Prev by Date: async NSOperation and NSOperationQueue
  • Next by Date: Re: Using NSTrackingArea on overlay child windows
  • Previous by thread: Re: Garbage collector vs variable lifetime
  • Next by thread: Re: Garbage collector vs variable lifetime
  • Index(es):
    • Date
    • Thread