[cfe-users] Improve compile performance when using Clang 3.6

Jeffrey Walton noloader at gmail.com
Wed Apr 1 23:19:05 PDT 2015


Hi Alexey,

>> Is there anything obvious I am missing that might affect the
>> performance between 3.5 and 3.6? Like is something enabled that used
>> to be disabled or missing?
> ...
> Interesting. Could you share the performance numbers, and try to figure out
> which specific sanitizer
> is causing a problem (i.e. try to compare just -fsanitize=address, and then
> various flavors of -fsanitize=undefined
> one by one: -fsanitize=shift, -fsanitize=null etc.). We are not aware of
> known performance degradation under
> sanitizers in 3.6 release.

Here are the performance numbers that I am experiencing. All tests
were run on the same machine (OS X 10.8.5, fully patched).

3.4.2:  ~5 minutes
3.5:      ~7 minutes, 30 seconds
3.6:      ~9 minutes

I'm used to building with Clang 3.3 and 3.4, so I wanted to include
one of those versions. With 3.6, the time has nearly doubled.

Are the numbers above on par with what you would expect?

Jeff

***** Crypto++ *****

If interested, you can checkout Crypto++ with:

    svn checkout https://svn.code.sf.net/p/cryptopp/code/trunk/c5 cryptopp

Tweaks to the GNUmakefile include: -g3 -Os -fPIC -stdlib=libc++
-fsanitize=address -fsanitize=undefined

A full GNUmakefile diff is available at http://pastebin.com/3mqEBKzP.

***** Clang 3.4.2 *****

Elapsed time: 01:17:06 - 01:12:05 ~= 5 minutes.

$ export CXX=/usr/local/bin/clang++
$ $CXX --version
clang version 3.4.2 (tags/RELEASE_34/dot2-final)
Target: x86_64-apple-darwin12.6.0
Thread model: posix
$ date && make static && date
Thu Apr  2 01:12:05 EDT 2015
/usr/local/bin/clang++ -DNDEBUG -g3 -Os -fPIC -stdlib=libc++
-fsanitize=address -fsanitize=undefined -Wall
-Wno-tautological-compare -Wno-unused-value -Wno-unused-variable
-Wno-unused-parameter -Wno-unused-function -I/usr/lib/c++/v1
-DCRYPTOPP_DISABLE_ASM -pipe -c 3way.cpp
/usr/local/bin/clang++ -DNDEBUG -g3 -Os -fPIC -stdlib=libc++
-fsanitize=address -fsanitize=undefined -Wall
-Wno-tautological-compare -Wno-unused-value -Wno-unused-variable
-Wno-unused-parameter -Wno-unused-function -I/usr/lib/c++/v1
-DCRYPTOPP_DISABLE_ASM -pipe -c adler32.cpp
...
/usr/local/bin/clang++ -DNDEBUG -g3 -Os -fPIC -stdlib=libc++
-fsanitize=address -fsanitize=undefined -Wall
-Wno-tautological-compare -Wno-unused-value -Wno-unused-variable
-Wno-unused-parameter -Wno-unused-function -I/usr/lib/c++/v1
-DCRYPTOPP_DISABLE_ASM -pipe -c zlib.cpp
libtool -static -o libcryptopp.a 3way.o adler32.o algebra.o algparam.o
arc4.o asn.o authenc.o base32.o base64.o ...
ranlib libcryptopp.a
Thu Apr  2 01:17:06 EDT 2015

***** Clang 3.5 *****

Elapsed time: 00:31:53 - 00:24:36 ~= 7 minutes, 30 seconds.

$ export CXX=/usr/local/bin/clang++
$ $CXX --version
clang version 3.5.0 (tags/RELEASE_350/final)
Target: x86_64-apple-darwin12.6.0
Thread model: posix
$ date && make static && date
Thu Apr  2 00:24:36 EDT 2015
/usr/local/bin/clang++ -DNDEBUG -g3 -Os -fPIC -stdlib=libc++
-fsanitize=address -fsanitize=undefined -Wall
-Wno-tautological-compare -Wno-unused-value -Wno-unused-variable
-Wno-unused-parameter -Wno-unused-function -I/usr/lib/c++/v1
-DCRYPTOPP_DISABLE_ASM -pipe -c 3way.cpp
/usr/local/bin/clang++ -DNDEBUG -g3 -Os -fPIC -stdlib=libc++
-fsanitize=address -fsanitize=undefined -Wall
-Wno-tautological-compare -Wno-unused-value -Wno-unused-variable
-Wno-unused-parameter -Wno-unused-function -I/usr/lib/c++/v1
-DCRYPTOPP_DISABLE_ASM -pipe -c adler32.cpp
...
/usr/local/bin/clang++ -DNDEBUG -g3 -Os -fPIC -stdlib=libc++
-fsanitize=address -fsanitize=undefined -Wall
-Wno-tautological-compare -Wno-unused-value -Wno-unused-variable
-Wno-unused-parameter -Wno-unused-function -I/usr/lib/c++/v1
-DCRYPTOPP_DISABLE_ASM -pipe -c zlib.cpp
libtool -static -o libcryptopp.a 3way.o adler32.o algebra.o algparam.o
arc4.o asn.o authenc.o base32.o base64.o ...
ranlib libcryptopp.a
Thu Apr  2 00:31:53 EDT 2015

***** Clang 3.6 *****

Elapsed time: 2:17:01 - 02:07:53 ~= 9 minutes.

$ export CXX=/usr/local/bin/clang++
$ $CXX --version
clang version 3.6.0 (tags/RELEASE_360/final)
Target: x86_64-apple-darwin12.6.0
Thread model: posix
$ date && make static && date
Thu Apr  2 02:07:53 EDT 2015
/usr/local/bin/clang++ -DNDEBUG -g3 -Os -fPIC -stdlib=libc++
-fsanitize=address -fsanitize=undefined -Wall
-Wno-tautological-compare -Wno-unused-value -Wno-unused-variable
-Wno-unused-parameter -Wno-unused-function -I/usr/lib/c++/v1
-I/usr/lib/c++/v1 -DCRYPTOPP_DISABLE_ASM -pipe -c 3way.cpp
/usr/local/bin/clang++ -DNDEBUG -g3 -Os -fPIC -stdlib=libc++
-fsanitize=address -fsanitize=undefined -Wall
-Wno-tautological-compare -Wno-unused-value -Wno-unused-variable
-Wno-unused-parameter -Wno-unused-function -I/usr/lib/c++/v1
-I/usr/lib/c++/v1 -DCRYPTOPP_DISABLE_ASM -pipe -c adler32.cpp
...
/usr/local/bin/clang++ -DNDEBUG -g3 -Os -fPIC -stdlib=libc++
-fsanitize=address -fsanitize=undefined -Wall
-Wno-tautological-compare -Wno-unused-value -Wno-unused-variable
-Wno-unused-parameter -Wno-unused-function -I/usr/lib/c++/v1
-I/usr/lib/c++/v1 -DCRYPTOPP_DISABLE_ASM -pipe -c zlib.cpp
libtool -static -o libcryptopp.a 3way.o adler32.o algebra.o algparam.o
arc4.o asn.o authenc.o base32.o base64.o ...
ranlib libcryptopp.a
Thu Apr  2 02:17:01 EDT 2015



More information about the cfe-users mailing list