automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PCH support


From: Olaf van der Spek
Subject: Re: PCH support
Date: Sun, 25 Dec 2011 18:45:07 +0100

On Sun, Dec 25, 2011 at 6:02 PM, Miles Bader <address@hidden> wrote:
> 2011/12/26 Olaf van der Spek <address@hidden>:
>> On Sun, Dec 25, 2011 at 5:31 PM, Miles Bader <address@hidden> wrote:
>>> 2011/12/26 Olaf van der Spek <address@hidden>:
>>>>> Faster enough to be worth the annoyance for the developer of twisting
>>>>> his source code to fit the "pch style" (which seems notably uglier)?
>>>>
>>>> Yes
>>>> I'm not sure what twisting you're referring too though.
>>>
>>> Another comment noted that PCH was often ineffective or even
>>> counter-productive unless the bulk of your includes are precisely the
>>> same between compilation units, and that in practice systems like VS
>>> try to get the user to define a single "include everything" header
>>> file (presumably instead of the normal practice of "include the stuff
>>> you use").
>>>
>>> Sounds pretty darn ugly (and I expect makes compile times far worse if
>>> you _can't_ use PCH in some case)...
>>
>> Is someone forcing you to use PCH? I'm not sure what your point is.
>
> Er, of course not (where on earth did that come from)?

I didn't get your point and it seemed you were repeating unfounded arguments.

> My initial question was essentially "is PCH still a good idea for the
> average developer?"
>
> That basically involves examining the details of the tradeoff between
> benefits (increased compile speed; how much?) and drawbacks (awkward
> constraints on source style / organization; exactly what is needed to
> make PCH effective?).

I measured speedup of 70% without -O3 and 50% with -O3 on one of my
projects when build with g++.
The project is primarily developed on MSVC so it already had a
stdafx.h (pch header).
I don't find the common header awkward at all, I'd rather not repeat
lots of the common includes in lots of source files.

> This is relevant to automake because the general utility of
> specialized PCH support in automake has to be weighed against the cost
> of that support (of course, maybe it's super trivial, I dunno).

Right. I think the cost is low, since the concept is so simple.

Olaf



reply via email to

[Prev in Thread] Current Thread [Next in Thread]