apple clang vs macports clang performance

René J.V. Bertin rjvbertin at gmail.com
Wed Jan 28 14:58:08 PST 2015


On Wednesday January 28 2015 15:23:04 Lawrence Velázquez wrote:

> 
> That directory looks like it's very much for Xcode's internal use only.
> 
>     % ls -1 $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/lib

Really now, even if that's true for the other stuff in there, it shouldn't be for libclang (and possibly libLTO, I don't really know what that one is for).
Or else Apple does do "secret" things with its clang version ...

> Neither the Xcode SDKs nor the CLT contain those libraries, so I expect

Eh? The CLT have libclang in /usr/lib. That library is of course only useful code that uses functionality clang provides. Exactly what kdev-clang does: it provides a clang-based C/C++ parser. You can compare it to the debugger library for which lldb is a front-end that could be replaced by a graphical front-end, or one that looks and feels like gdb.

> It would, yes. It'd be useful if you could actually demonstrate the
> performance gap you're seeing.

Well, since I was rebuilding port:akonadi anyway I tried, and was not disappointed:

Full build from scratch immediately after the cmake call, using Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn) and make -j4:
real    2m40.630s
user    7m57.903s
sys     1m18.904s
0m0.003s 0m0.003s
7m57.905s 1m18.907s
477.909 user_cpu 78.911 kernel_cpu 2:40.64 total_time 346.6%CPU {0W 0X 0D 0K 69142528M 5999F 5207516R 90I 671O 0r 0s 1756k 3894w 278025c}

Idem, in a parallel virgin directory, using port:clang-3.5 version 3.5.0 (tags/RELEASE_350/final):
real    5m17.493s
user    17m6.203s
sys     1m29.038s
0m0.003s 0m0.002s
17m6.205s 1m29.040s
# Wed Jan 28 21:14:39 CET 2015
1026.209 user_cpu 89.046 kernel_cpu 5:17.53 total_time 351.2%CPU {0W 0X 0D 0K 70668288M 5586F 5920757R 637I 1055O 0r 0s 1756k 4239w 483413c}

Note that I installed the default llvm and clang versions, so I have the binary package versions.

Shame I cannot compare with gcc, but when I did (gcc-mp-4.8 vs. clang-mp-3.4 vs. Apple's clang 3.4 variant) on 10.6, gcc 4.8 was faster than Apple gcc 4.2 and clang-mp-3.4 but slower than Apple clang 5 on 10.9 . On Linux clang-3.4 was faster than gcc-4.8, however.

If assertions are involved this almost begs the question if they are really deactivated in the -assertions builds!

R.


More information about the macports-dev mailing list