Diagnosing header pollution?

Host builds under Linux/GCC have gotten a tad slow. I threw in a couple of #pragma warnings and it seems to be spending most of its time munching on headers.

Anyone any experience on diagnosing compiler slow down with GCC? Usually it’s header pollution, and I’m trying to figure out non-retarded ways to get talk CMake into generating per-target precompiled headers automatically, but in the meantime… I could really use figuring out where mah slowdown is.


My C++ code is so heavily templated that it’s basically 80% headers, so I’ve given up on having it compile speedily… So no, I’ve just admitted defeat.

Lol – I found the GCC -H argument, although I swear it wasn’t there before I posted this ;)

KFS, I’ll share an idea a fellow coworker did once about header pollution. He wrote a script that recursively removed #include statements until the project wouldn’t compile. If the compiled failed, he skipped over that #include. I believe he purged over 500 entries.

Of course, I googled header pollution to make sure that this is what you were talking about, but as it turns out, you are the first hit 

Rofl – I’ve actually done that myself. Hmm. I probably have the script somehwere.

But, it was finding GCC -H that I wanted :)

Leave a Reply

Name and email address are required. Your email address will not be published.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <pre> <q cite=""> <s> <strike> <strong> 

%d bloggers like this: