[llvm-dev] llvm and clang are getting slower

Sean Silva via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 8 11:43:13 PST 2016


In case someone finds it useful, this is some indication of the breakdown
of where time is spent during a build of Clang.

tl;dr: in Debug+Asserts about 10% of time is spent in the backend and in
Release without asserts (and without debug info IIRC) about 33% of time is
spent in the backend.


These are the charts I collected a while back breaking down the time it
takes clang to compile itself.
See the thread "[cfe-dev] Some DTrace probes for measuring per-file time"
for how I collected this information. The raw data is basically aggregated
CPU time spent textually parsing each header (and IRGen'ing them, since
clang does that as it parses. There are also a couple "phony" headers to
cover stuff like the backend/optimizer.

Since there a large number of files, the pie charts below are grouped into
rough categories. E.g. the "llvm headers" includes the time spent on
include/llvm/Support/raw_ostream.h and all other headers in include/llvm.
The "libc++" pie slice contains the time spent in the libc++ system headers
(this data was collected on a mac, so libc++ was the C++ standard library).
"system" are C system headers.

All time spent inside the LLVM optimizer is in the "after parsing" pie
slice.


Debug with asserts:


[image: Inline image 1]



Release without asserts (and without debug info IIRC):


[image: Inline image 2]



-- Sean Silva

On Tue, Mar 8, 2016 at 8:13 AM, Rafael EspĂ­ndola <llvm-dev at lists.llvm.org>
wrote:

> I have just benchmarked building trunk llvm and clang in Debug,
> Release and LTO modes (see the attached scrip for the cmake lines).
>
> The compilers used were clang 3.5, 3.6, 3.7, 3.8 and trunk. In all
> cases I used the system libgcc and libstdc++.
>
> For release builds there is a monotonic increase in each version. From
> 163 minutes with 3.5 to 212 minutes with trunk. For comparison, gcc
> 5.3.2 takes 205 minutes.
>
> Debug and LTO show an improvement in 3.7, but have regressed again in 3.8.
>
> Cheers,
> Rafael
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160308/c020a549/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LLVM release without asserts.png
Type: image/png
Size: 59043 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160308/c020a549/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LLVM for_zygoloid (default CMake config).png
Type: image/png
Size: 60513 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160308/c020a549/attachment-0003.png>


More information about the llvm-dev mailing list