• 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: Xcode 4.3.1 memory usage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode 4.3.1 memory usage


  • Subject: Re: Xcode 4.3.1 memory usage
  • From: email@hidden
  • Date: Mon, 19 Mar 2012 13:57:23 +0000

On 16 Mar 2012, at 23:02, Jens Alfke wrote:


On Mar 16, 2012, at 3:31 PM, email@hidden wrote:

This one 4039 line file is the source of the trouble:
https://github.com/pmougin/F-Script/blob/master/FScriptFramework/FSObjectBrowserViewObjectInfo.m

clang Real Memory memory usage hits 4 to 5 GB when compiling this one file over a period of some 15 minutes or so.
If the build is cancelled before compilation completes then subsequent builds fail with a linker error:

That source file contains a pathologically long method named -fillMatrix:withObject:. It’s over 3000 lines long! Huge functions like this have always presented problems for code optimizers — I’m not an expert on compiler techniques, but I believe there are data structures and algorithms used in optimization that tend to grow as at least O(n^2) with the number of basic blocks or branches in the function being optimized.


I refactored the monster function using a helper object and saw massive improvements.
The file now compiles in 20secs and uses 250MB ram which greatly improves the build performance for my app as a whole.

I typically like to include third party frameworks as sub projects within my app project rather than just using the framework binary.
This naturally gives longer builds following a clean but it also makes it easier to say on top of issues as APIs and tool chains evolve. 

The refactored class is here:
https://github.com/mugginsoft/F-Script/blob/master/FScriptFramework/FSObjectBrowserViewObjectInfo.m

Regards

Jonathan Mitchell
Mugginsoft LLP


 _______________________________________________
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

References: 
 >Re: Xcode 4.3.1 memory usage (From: Brad Oliver <email@hidden>)
 >Re: Xcode 4.3.1 memory usage (From: Sean McBride <email@hidden>)
 >Re: Xcode 4.3.1 memory usage (From: Brad Oliver <email@hidden>)
 >Re: Xcode 4.3.1 memory usage (From: Sean McBride <email@hidden>)
 >Re: Xcode 4.3.1 memory usage (From: "email@hidden" <email@hidden>)
 >Re: Xcode 4.3.1 memory usage (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Brace Insertion Tweak
  • Next by Date: Impossible to remove xcdatamodel from xcdatamodeld?
  • Previous by thread: Re: Xcode 4.3.1 memory usage
  • Next by thread: Offlist Re: Xcode 4.3.1 memory usage
  • Index(es):
    • Date
    • Thread