• 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: where are the faster compilations?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: where are the faster compilations?


  • Subject: Re: where are the faster compilations?
  • From: "Timothy J. Wood" <email@hidden>
  • Date: Sat, 24 Aug 2002 14:40:19 -0700

On Saturday, August 24, 2002, at 02:05 PM, Matt Neuburg wrote:

The Jaguar dev tools specifically claim to have "Faster compilation times
due to a new precompiled header mechanism." But OMM the first compilation -
the only one that was ever slow - is still slow, pausing for ages during
the compilation of main.c. If this isn't what's faster, what is? Have I
misunderstood the point of the precompiled headers? Thx - m.

You need to build a prefix header, set the target options to use this header as a prefix header, check the precompile flag next to the prefix header field and then tell PB to use PFE (in the compiler settings section).

The game I'm working on builds HUGELY faster with this.

Some things to be careful of:

- The prefix header is (IMO, correctly) considered a dependancy of all files. Thus, if you change any header that is imported in the prefix header, everything will rebuild. You should only put headers in this file that you aren't going to be changing very often.

- Adding '--dbgpfe=h' to the compiler options will cause the complier to spit out messages about whether each header it imports came from a PFE or not. This can help you in making sure that you have everything in the PFE that you need (just do a full build and then add stuff that the compiler says that was missing, taking into account the previous point about not including stuff you'll be changing often).

- If you have a mix of languages in your project, PB needs to build the PFE once in each style. Additionally, the prefix header will get included in EVERY file in your project. Thus, if you have both ObjC and C++ (not ObjC++), you may want to do something like:

// include vanilla C headers
#ifdef __OBJC__
// include headers that have ObjC syntax in them
#endif
#ifdef __cplusplus
// include any C++ headers
#endif

The different PFE variants will then have different contents based on the language in question.

- As a corollary to the previous point, if you have only one file in a specific language, consider converting it to a different language. For example, if you have a directory full of ObjC++ files and one pure ObjC file, PB will have to build a pure ObjC version of the PFE file (and this can take a while). If you convert that last file to ObjC++, then you'll have to build one fewer variant of the PFE. This is probably a minor savings in the grand scheme of things, but it can help a little.

I hope this helps -- PFE certainly helped me a bunch :)

-tim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >where are the faster compilations? (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re:
  • Next by Date: Re: NULL SEL arguments in Jaguar?
  • Previous by thread: Re: where are the faster compilations?
  • Next by thread: Re: where are the faster compilations?
  • Index(es):
    • Date
    • Thread