[cfe-dev] clang performance when building Linux

Török Edwin edwintorok at gmail.com
Sat Apr 16 13:48:59 PDT 2011


On 2011-04-16 23:32, Chandler Carruth wrote:
> On Sat, Apr 16, 2011 at 5:01 AM, Benjamin Kramer
> <benny.kra at googlemail.com <mailto:benny.kra at googlemail.com>> wrote:
> 
>     >     3.65%     clang  clang                              [.]
>     llvm::StringMapImpl::LookupBucketFor(llvm::StringRef)
> 
>     I'm a bit surprised that StringMap is the most expensive entry here,
>     maybe microoptimizing
>     the hash function (which is a byte-wise djb hash at the moment) can
>     help a bit. If someone is
>     really bored it would also be useful to test if other string hash
>     functions like murmurhash or google's
>     new city hash give better performance.
> 
> 
> Interesting. I'm familiar with murmurhash and watched the development of
> city hash and am quite familiar with it. I'll take a look at what it
> would take to use cityhash here. Anything special done to produce these
> numbers? Just a build of the kernel?
> 
> If you could paste how you collected the perf data that would be useful
> as well... i've not used the 'perf' tool extensively before.

Here is what I used:
$ make allmodconfig
$ perf record make CC=clang -j6
(this creates a file perf.data, let it run for at least 2 or 5 minutes,
then interrupt it, or wait for it to finish)
$ perf report
(ncurses-like interface to browse perf.data)

If you get error messages from clang, you should probably use the kernel
from here:
https://github.com/lll-project/kernel

I used the LLVM and clang from here, but performance profiling could be
done equally well with llvm.org trunk versions:
https://github.com/lll-project/llvm
https://github.com/lll-project/clang

Best regards,
--Edwin



More information about the cfe-dev mailing list