gcc

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.

Nearly done with PreparedStatement

It’s been a really busy week – starting out with me going locking down on Monday and working from home to get a whole bunch of stuff blasted out without having to go cowboy.

Somehow, inbetween everything else, I’ve managed to get a little ‘recreational coding’ out of the genuine need to get prepared statements integrated into the codebase for what we’re doing with the auth process.

So far, I only need data modifying statements, but the natural progression is a general encapsulation that will also support call/select etc. (Right now I never even both fetching the result set because none of my queries needs to).

GCC supports precompiled headers

What are you talking about? If you ask GCC to compile a file with a “.h suffix, it will write out a similarly named file with “.gch” tacked on the end. And then, when something includes that file, it’ll do some checks and if everything is equal, it’ll use that precompiled header.

(Note: the words “everything” and “equal” and “use” are implementation and implementer specific and as such are subject to interpretation, discussion, reinterpretation, adjustment, argument, debate, readjustment, consideration, evaluation, re-evaluation, alcohol, burning, smiting, testosterone imbalances, puberty, intent to reach puberty within the next couple of years, rejection, dismissal, disregard, disrepect and generally anything but clear definition – if you really want to know, all you have to do is read the source code, stay up to date with the latest revisions from source control, stay active on the mailing list and nearly 40 blogs which occasionally mention gcc, its not like we get paid to do this. Thank you for choosing Open Source!)

Precompiled headers

Our project just takes too long to compile. It’s only a few hundred thousand lines of code, but it compiles like there are millions.

I’ve spent most of last night and today reorganizing header files and project files and turning our primary include file set into a single, precompilable header.

Visual Studio, dramatic effect: just over 2 minutes 27 seconds off the time to build the entire project while also adding our network API to the build! Xcode seems about the same or slower (I’ll benchmark that next week) and I got tired of wrestling with autoconf/automake under Linux for the host.