• 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 Collection Performance Hit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Garbage Collection Performance Hit


  • Subject: Re: Garbage Collection Performance Hit
  • From: Chris Espinosa <email@hidden>
  • Date: Wed, 31 Oct 2007 11:21:10 -0700

On Oct 31, 2007, at 10:43 AM, Robert Martin wrote:

I just finished converting a file scanning project to XCode 3, and tried the GC. It worked without a hitch, except the performance took a big hit. For example, a file that can be scanned at 1300 KB/Sec without GC now averages 850 KB/sec with GC. Is this a typical performance hit?

File scanning can be a pathological case for GC as it involves rapid allocation and deallocation of large amounts of memory, and if you're not careful, reading in the files can blow out your disk cache as well as causing swapping, which can contend with the collector.  Using no-cache mmapped files for scanning, or holding a memory buffer that you slide across the files for scanning instead of allocating and deallocaing memory, can make this more efficient.

In normal cases we see between 5% and 15% performance penalty for garbage collection, and some algorithms actually get a performance increase because the collector (unlike free) can run on a separate thread and use a second core on a multiprocessor system.

email@hidden might be a better place to get specific details on Objective-C garbage collection.

Chris
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Garbage Collection Performance Hit
      • From: "Adam R. Maxwell" <email@hidden>
References: 
 >Garbage Collection Performance Hit (From: Robert Martin <email@hidden>)

  • Prev by Date: Re: Garbage Collection Performance Hit
  • Next by Date: Re: Garbage Collection Performance Hit
  • Previous by thread: Re: Garbage Collection Performance Hit
  • Next by thread: Re: Garbage Collection Performance Hit
  • Index(es):
    • Date
    • Thread