[cfe-dev] Compile-time measurements in Chromium

Nico Weber thakis at chromium.org
Tue Feb 7 08:11:32 PST 2012


Hi,

nice numbers :-) One thing to keep in mind is that these are
compile-time numbers, but the object files generated by clang tend to
take ~20% longer to link than the ones generated by gcc, due to chubby
debug information.

I did incremental builds (touch one file, measure rebuild time – this
measures almost exclusively ld time) of the chrome binary in several
scenarios. In debug builds, the object files generated by clang take
up to 6 seconds longer to link into a final binary (36s instead of
30s, or in with a shared library build, 31s instead of 27s). In
release builds, there's no big difference.

So while compiling with clang is faster, linking the resulting object
files currently takes longer.

Nico


ps: Raw numbers (each is the min of 3 runs):

Chrome incremental build times (ninja, gold on by default, debug
builds, gcc4.4, chromeclang)
gcc
touch file in net (net/base/mime_util.cc) 29.4s
touch file in browser (c/b/u/g/chrome_gtk_frame.cc) 32.8s

clang
touch file in net 35.9s
touch file in browser 36.3s

gcc component build (libv8.so instead of libv8.a etc)
touch file in net 26.5s
touch file in browser 8.7s

clang component build
touch file in net 30.8s
touch file in browser 10.6s

(release builds)
gcc
touch file in net 6.4s
touch file in browser 5.9s

clang
touch file in net 6.3s
touch file in browser 6.2s

gcc component
touch file in net 6.7s
touch file in browser 3.1s

clang component
touch file in net 6.6s
touch file in browser 3.2s

On Mon, Feb 6, 2012 at 9:42 AM, Hans Wennborg <hans at chromium.org> wrote:
> 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
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>




More information about the cfe-dev mailing list