[LLVMdev] LLVM compile speed significantly slower than GCC (w/ test case)

Jim Grosbach grosbach at apple.com
Thu Jul 19 16:31:40 PDT 2012


Thanks, Matt. This is great information. Sounds like Chandler is looking into the details of what's going on.

-Jim

On Jul 19, 2012, at 3:55 PM, Matt Fischer <mattfischer84 at gmail.com> wrote:

> I've been doing some profiling of LLVM on our codebase, to see how it
> stacks up to the existing GCC build that we do.  The primary thing I'm
> focusing on at the moment is build speed, and in this regard LLVM
> seems to be pretty all over the map.  On some files it seems to go
> quite a bit faster than GCC, and on others it's slower, leading to an
> aggregate build time for our repository that's roughly the same as
> GCC.
> 
> Some IRC discussions suggested that you guys might be interested in
> seeing an example of a file that goes appreciably slower, so I managed
> to isolate one that's completely self-contained.  It's a relatively
> stock implementation of the SHA1 algorithm, so it should be a pretty
> straightforward file to follow, as well as being a relatively
> data-intensive piece of code.
> 
> I compiled the file with both compilers for the arm-none-eabi triple.
> The numbers I get are as follows:
> 
> GCC (4.5.2, Windows build from CodeSourcery) - With -O0: 110ms, with -O2: 215ms
> Clang/LLVM (Release mode, LLVM git hash 7f5714f4..., clang git hash
> 9d9cf5...) - With -O0: 110ms, with -O2: 640ms
> 
> The compilers are essentially identical for the -O0 case, but when
> compiling with -O2, LLVM takes almost three times as long as GCC.
> 
> I'm not sure whether this file is unusual in some way, such that
> fixing whatever makes this slow wouldn't have much of an effect on
> other files, or if this is evidence of some problem that's broad
> enough to improve the compile speed of a wide variety of files.  If
> anybody is interested in investigating the discrepancy, though, I'd
> love to hear about it.
> 
> Thanks,
> Matt
> <sha1test.c>_______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list