This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
re: build time profiling?
- From: Dan Kegel <dank at kegel dot com>
- To: GCC Mailing List <gcc at gcc dot gnu dot org>, troy at resophonic dot com
- Date: Sat, 07 Aug 2004 14:36:24 -0700
- Subject: re: build time profiling?
Troy wrote:
I'm working on a project now that is a real rat's nest of templates
and unnecessary (or mostly unnecessary) #includes. As we start to
try to disentangle things, it would be nice to see where to put the
effort... e.g. which header files take the longest to compile, which get
compiled most often. Generally a profile of what has taken how much time
over *multiple* gcc runs. Otherwise one just greps a bit, sees which
header files are included most often, makes some guesses about which
templates are most costly and often used, that kind of thing. Not an
optimal method.
This topic does not google well. "build time profiling" gets you a bunch
of stuff about gcov and -pg. ...
How 'bout compile everything with -E, concatenate all the source,
and grep '#' | sort | uniq -c ?
The most frequently occurring lines would indicate the files
that get included the most often, maybe you could look for ways
to not include those files.
Or maybe run a build under strace, and have it only look at 'open'
system calls, maybe.
- Dan
--
My technical stuff: http://kegel.com
My politics: see http://www.misleader.org for examples of why I'm for regime change