Re: precompiled headers and Sun Studio 10...
From: Thomas Maier-Komor (maierkom_at_lpr.e-technik.no-spam.tu-muenchen.de)
Date: 09/22/05
- Next message: stroller: "Re: newbie question"
- Previous message: gvelmurugan_at_gmail.com: "Re: how to find whether my HD is good or bad"
- In reply to: Trond Norbye: "precompiled headers and Sun Studio 10..."
- Next in thread: Paul Floyd: "Re: precompiled headers and Sun Studio 10..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 22 Sep 2005 09:43:47 +0200
Trond Norbye schrieb:
> 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 used the following make rule to compile the files:
>
> $(COMPILE.cc) -xpch=use:pch -xpchstop=pch.h filename
>
> And when I timed the runs I got:
>
> without precompiled headers: 30 seconds, with precompiled headers: 1m 30
> sec.
>
> When I look at the content of pch.Cpch it looks to me that this file is
> just a preprocessed version of all of the headers. Is this correct?
>
> Should I be doing this another way?
>
> Trond
in my experience using precompiled headers is not worth the effort.
There might be cases where you really get improved compile time.
But I guess these situations are limited to case of e.g. gui
development, where most translation units include the same set
of header files. In my project it also gave a regression
concerning compile-time and additional dependencies for
the build process. So I switched back to normal compilation.
But then this was just a small project and I was using Studio 9.
Cheers,
Tom
- Next message: stroller: "Re: newbie question"
- Previous message: gvelmurugan_at_gmail.com: "Re: how to find whether my HD is good or bad"
- In reply to: Trond Norbye: "precompiled headers and Sun Studio 10..."
- Next in thread: Paul Floyd: "Re: precompiled headers and Sun Studio 10..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|