<div dir="ltr">Hi,<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 7, 2013 at 10:53 PM, Igor Vagulin <span dir="ltr"><<a href="mailto:igor.vagulin@gmail.com" target="_blank">igor.vagulin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Richard,<br>
<br>
I've spend few days tweaking all possible flags on clang to make it<br>
work close to gcc. At best found combination clang was only about 30%<br>
worse than gcc(4.4 from rhel-6). Maybe you can give me another hint? I<br>
really want to switch :).<br>
<br>
I've create 100 copies of RemoveClusterObserver.cpp, below is test<br>
results of "time g++|clang++ -c RemoveClusterObserver-*cpp"<br>
g++: 0m58.510s<br>
clang++ default opts: 2m4.065s<br>
+ march=core2: 1m43.729s<br>
+ BUILD_SHARED_LIBS=NO: 1m27.216s<br>
+ by-clang-build-by-clang++: 1m18.816s<br>
<br>
I've also trying measure compile time of clang sources, I thought this<br>
case should be comfortable for clang. No luck, clang still worse in<br>
every scenario. BTW here I also measured intel c compiler.<br>
- gcc-4.4:<br>
real 7m7.759s<br>
user 45m53.622s<br>
sys 2m3.657s<br>
- icc 2013-sp1:<br>
real 8m4.175s<br>
user 54m39.116s<br>
sys 2m35.159s<br>
- clang compiled by gcc:<br>
real 8m42.278s<br>
user 60m19.175s<br>
sys 0m51.341s<br>
- clang compiled by icc (who is paying for this compiler? :-/):<br>
real 8m2.399s<br>
user 57m31.185s<br>
sys 0m57.272s<br>
<br>
Then I thought maybe problem is x86 architecture and lack of register<br>
and switched to x86_64. Looks like that's the case, and people<br>
claiming "clang compiles faster than gcc" mean "on x86_64".<br>
- gcc:<br>
real 8m8.230s<br>
user 50m1.458s<br>
sys 3m44.313s<br>
- clang compiled by gcc:<br>
real 7m57.747s<br>
user 55m16.080s<br>
sys 1m27.786s<br>
- clang compiled by clang:<br>
real 6m41.412s<br>
user 44m53.298s<br>
sys 1m27.715s<br>
Igor Vagulin<br>
<br>
<br></blockquote><div>These are interesting results, but there are other variables that might be explaining the<br>differences other than extra registers. Are you compiling on the same machine in x86 and<br></div><div>x86_64 mode, or are they different machines with different amounts of memory? It might<br>
also be somewhat of the usual trade-off between keeping stuff in memory vs doing stuff<br>in discrete steps via intermediate files being better or worse depending if you've got<br></div><div>a "enough memory to hold it all" or not. (This is just suggested by the way your system<br>
times are always much lower for clang on both x86 and x86-64.) Building clang in particular<br>is known to be very heavy on the memory.<br><br></div><div>Cheers,<br>Dave<br></div><br></div>-- <br><div>cheers, dave tweed__________________________</div>
<div>high-performance computing and machine vision expert: <a href="mailto:david.tweed@gmail.com" target="_blank">david.tweed@gmail.com</a></div><div>"while having code so boring anyone can maintain it, use Python." -- attempted insult seen on slashdot</div>
<div> </div>
</div></div></div>