This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: libsanitizer builds slowly
- From: Markus Trippelsdorf <markus at trippelsdorf dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>, Mike Stump <mikestump at comcast dot net>, Kostya Serebryany <kcc at google dot com>, gcc List <gcc at gcc dot gnu dot org>, "H.J. Lu" <hongjiu dot lu at intel dot com>
- Date: Mon, 27 Jan 2014 12:28:47 +0100
- Subject: Re: libsanitizer builds slowly
- Authentication-results: sourceware.org; auth=none
- References: <01399663-DEE6-47B1-BA41-408E2653758A at comcast dot net> <20131216201707 dot GV892 at tucnak dot redhat dot com> <CAGQ9bdzHSo_bXVYMn5vFZfOsbE7dwH1m0nNga2+DZenssWO0Dw at mail dot gmail dot com> <20131217064310 dot GB892 at tucnak dot redhat dot com>
On 2013.12.17 at 07:43 +0100, Jakub Jelinek wrote:
> On Tue, Dec 17, 2013 at 08:45:13AM +0400, Konstantin Serebryany wrote:
> > Indeed, the compile time is dominated by asan_interceptors.cc:
> > % touch ~/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc
> > % date; ninja libclang_rt.asan-x86_64.a libclang_rt.asan-i386.a ; date
> > Tue Dec 17 08:39:38 MSK 2013
> > [4/4] Linking CXX static library lib/clang/3.5/lib/linux/libclang_rt.asan-i386.a
> > Tue Dec 17 08:39:42 MSK 2013
> >
> > But I think that 4 seconds for one file (+link time) is reasonable enough.
>
> I bet this is just a combination of slow CPU, non release compiler (i.e. not
> --enable-checking=release, with lots of extra asserts) and building 4 copies
> of it rather than 1 (or 2?) - -fPIC/non-pic times {x86_64,i686}.
> Anyway, if I look at -ftime-report, there is nothing obviously too slow,
> var-tracking is the worst with taking ~ 18% of wall time, RTL sharing
> verification 4%, tree verifiers 4%+7%, RA 5%, RTL PRE 4%, parser, GC, cfg verifier, df
> live, tree PRE each about 3%.
On my old AMD Phenom testbox the various *-interceptors are a clear
bottleneck during bootstrap.
With "-g -O2" during last stage (checking=release) for asan_interceptors.cc:
Execution times (seconds)
phase opt and generate : 10.73 (97%) usr 0.45 (82%) sys 11.19 (96%) wall 212930 (83%) ggc
var-tracking dataflow : 2.49 (22%) usr 0.01 ( 2%) sys 2.54 (22%) wall 57 ( 0%) ggc
TOTAL : 11.08 0.55 11.64 257544
with "-O2":
phase opt and generate : 6.78 (97%) usr 0.41 (77%) sys 7.20 (96%) wall 166845 (81%) ggc
TOTAL : 6.98 0.53 7.52 205018
Would it be possible to rearrange the compilation order, so that the
interceptors would be build first (and not last as currently)?
--
Markus