Profiling the C++ compilation process

For GCC there are debugging options to find how much time is spent within each of the phases of C++ compilation?

-Q
Makes the compiler print out each function name as it is compiled, and print some statistics about each pass when it finishes.

-ftime-report
Makes the compiler print some statistics about the time consumed by each pass when it finishes.

Passes are described in GCCINT 9: Passes and Files of the Compiler.

You can post output of g++ compilation of single source file with -v -ftime-report here to discuss it. There could be some help on the GCC mailing list.


For compilers other than GCC (or GCC more ancient than 3.3.6) see the other options in this thread.

Leave a Comment