[cfe-dev] Compile-time measurements in Chromium

Hans Wennborg hans at chromium.org
Mon Feb 6 09:42:51 PST 2012


Hello all,

I have been measuring compile times for Chromium using different
versions of GCC and Clang, and I thought it might be a good idea to
share the results in case someone else finds them interesting.

Two measurements were conducted: average compile time for a file in a
set of 100 randomly selected translation units, and average compile
time for a file in the set of the 10 translation units that are
slowest to compile.

Each translation unit was first compiled once for warm-up, and then
compiled five times using "perf stat -r5" [1]. The means of the wall
clock compile times were then added together and divided by number of
translation units.

The measurements were conducted on an x64 machine running Ubuntu
GNU/Linux. CPU frequency scaling had been disabled.

The GCC versions used were 4.4.6, 4.6.2, and 4.7 built from svn
revision r183805.
The Clang/LLVM versions used were 3.0, and 3.1 built from svn revision r149506.
The Chromium version used was r119678. Source is available from [2].

The flags used were -fsyntax-only -O0, -O0, -O0 -g, -O2, -O2 -g. Note
that the -fsyntax-only results are incomparable between compilers
since the flag means different things for GCC and Clang.

GCC was configured with "--enable-languages=c,c++ --disable-multilib
--enable-checking=release"
Clang was configured with "--enable-optimized --disable-assertions"

Attached are plots of the results and the full output from running the
measurements.

These are the average compile times for compiling a file in a set of
100 randomly selected files: (time values in seconds)

            gcc 4.4  gcc 4.6  gcc 4.7  clang 3.0  clang 3.1
-fs-o -O0   0.450    0.458    0.501    0.449      0.439
-O0         0.624    0.631    0.684    0.504      0.494
-O0 -g      0.722    0.727    0.781    0.661      0.653
-O2         0.811    0.803    0.874    0.603      0.597
-O2 -g      0.916    0.979    1.06     0.809      0.809


These are the average compile times for compiling a file in the set of
the 10 files that are slowest (as when compiled with gcc 4.4 using
-O2) to compile:

            gcc 4.4  gcc 4.6  gcc 4.7  clang 3.0  clang 3.1
-fs-o -O0   2.18     1.70     1.86     1.70       1.66
-O0         5.87     5.33     5.71     2.90       2.85
-O0 -g      6.71     6.19     6.61     4.00       4.08
-O2         11.9     10.8     12.0     6.72       6.80
-O2 -g      13.2     13.6     15.1     9.57       9.78


Thanks,
Hans


[1] http://linux.die.net/man/1/perf-stat
[2] http://dev.chromium.org/developers/how-tos/get-the-code
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compile_time.png
Type: image/png
Size: 7878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120206/e8f9e569/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compile_time_top10.png
Type: image/png
Size: 8536 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120206/e8f9e569/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: measurements.log.gz
Type: application/x-gzip
Size: 29578 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120206/e8f9e569/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: measurements_top10.log.gz
Type: application/x-gzip
Size: 4167 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120206/e8f9e569/attachment-0001.bin>


More information about the cfe-dev mailing list