Re: precompiled headers and Sun Studio 10...
From: Paul Floyd (root_at_127.0.0.1)
Date: 09/24/05
- Next message: Frank Batschulat: "Re: unexpected allocated inode message"
- Previous message: Chris Ridd: "Re: Solaris 10 advantages and drawbacks"
- In reply to: Trond Norbye: "precompiled headers and Sun Studio 10..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 24 Sep 2005 20:42:06 GMT
On Wed, 21 Sep 2005 22:17:37 +0200, Trond Norbye <trond.norbye@gmail.com> wrote:
> I am currently trying to improve compile-time performance by introducing
> precompiled headers, but my tests so far have not given the expected
> results. Instead of a reduced compile time, I am getting an increased
> compile time.
>
> In my test I created a file called pch.cpp with the following content:
>
> #include "pch.h"
>
> And I compiled the file with:
>
> $(COMPILE.cc) -xpch=collect:pch -xpchstop=pch.h pch.cpp
>
> In pch.h I added all of the header files that I used in the 6 files I
> was going to compile. This might not be the best test, since it was only
> one or two header files that was common for all of the files, but I
> would expect a small decrease of compile time at least).
I'd expect an increase in compile time for the first build (and probably
each time you touch a header), but decreased build times when you touch
implementation files.
I did a few tests and found a small speed gain, but that it probably
took me longer to optimize finding which headers gave me that gain than
I would ever benefit from it.
My take on this is that PCH can be a big benefit on Wind32, where you
often include windows.h and/or a ton of MFC/AFX headers. Generally on
Solaris you don't have such Kitchen Sink headers, so you won't get as
much benefit.
YMMV depending on disk (or network), CPU speed and the amount of header
dependency you have.
A bientot
Paul
-- Paul Floyd http://paulf.free.fr (for what it's worth) Surgery: ennobled Gerald.
- Next message: Frank Batschulat: "Re: unexpected allocated inode message"
- Previous message: Chris Ridd: "Re: Solaris 10 advantages and drawbacks"
- In reply to: Trond Norbye: "precompiled headers and Sun Studio 10..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|