[cfe-commits] r54794 - in /cfe/trunk: include/clang/Lex/Token.h include/clang/Parse/Parser.h lib/Lex/Lexer.cpp lib/Parse/Parser.cpp lib/Sema/Sema.cpp lib/Sema/Sema.h lib/Sema/SemaExpr.cpp lib/Sema/SemaExprObjC.cpp

Daniel Dunbar daniel at zuster.org
Sat Aug 23 18:49:49 PDT 2008

> Yeah, good point, nevermind :)  One thing that Neil has pointed out is 
> that the startup time of clang is significantly more than it really 
> should be.  We've made progress on this, but I don't have a really 
> have a good handle on where the startup time is going now and how to 
> improve it.

A few minor data points:


On a C file of 'int x;', and running a Release-Asserts clang 1000 times
with just 'clang file.c' (i.e. -fsyntax-only).

real    0m7.750s
user    0m4.486s
sys    0m2.942s

With 'return 0;' after parsing arguments:
real    0m6.206s
user    0m3.507s
sys    0m2.414s

With 'return 0;' at top of main:
real    0m5.873s
user    0m3.153s
sys    0m2.356s

And for reference, 1000 times running 'true' on my system:
real    0m1.594s
user    0m0.309s
sys    0m1.143s


So it looks like the premain amount of overhead is pretty high compared
to the actual work we do. Static constructors aren't free?

 - Daniel

More information about the cfe-commits mailing list