• 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: Performance problem with GC enabled
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Performance problem with GC enabled


  • Subject: Re: Performance problem with GC enabled
  • From: Peter Ammon <email@hidden>
  • Date: Thu, 12 Mar 2009 12:17:18 -0700


On Mar 12, 2009, at 6:04 AM, John Engelhart wrote:


This is (obviously) due to -fobjc-gc turning the storing of a __strong pointer in to a call to objc_assign_strongCast(). Each and every call to objc_assign_strongCast, in turn, grabs a gc lock before it does its work. Soo.. what was a simple, single movl instruction of the returned pointer in to the matchedStrings array has now turned in to, at a minimum, a function call and an expensive mutex lock acquisition, a lock that is pretty heavily contested to boot, and that doesn't even include any of the work done inside the function itself.
....
This kind of reduction in performance is just flat out unacceptable,
and I can't think of anything I can do to speed things up.  Any ideas?


Hi John,

Instead of storing each string individually into the heap, try batching up, say, 1k or so into a stack allocated buffer. Then use objc_memmove_collectable() to move them in bulk into the heap at the point your stack allocated buffer gets full, or your scan finishes.

-Peter

_______________________________________________

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: Performance problem with GC enabled
      • From: John Engelhart <email@hidden>
References: 
 >Performance problem with GC enabled (From: John Engelhart <email@hidden>)

  • Prev by Date: Re: Develop and OSAX
  • Next by Date: Multiple Images into one UIView
  • Previous by thread: Re: Performance problem with GC enabled
  • Next by thread: Re: Performance problem with GC enabled
  • Index(es):
    • Date
    • Thread