[LLVMdev] speed and code size issues
Daniel Dunbar
daniel at zuster.org
Fri Jul 17 17:38:06 PDT 2009
Hi Jonathan,
Please pick one or two files you think are representative of the file
size problem and file bugs with the preprocessed inputs and command
line here:
http://llvm.org/bugs
As for the compile performance, its hard to do much with those full
build numbers. Can you see if the problem manifests itself with some
individual file, and file a bug if so (please include preprocessed
input and command lines)? Given the difference in code size, llvm-gcc
and clang would appear to be doing more work, so that will of course
negatively impact build times. However, I'm still surprised by your
times and would be happy to investigate if you can get me a test case.
- Daniel
On Fri, Jul 17, 2009 at 4:14 PM, Jonathan Gray<jsg at goblin.cx> wrote:
> So it would appear that llvm-gcc and clang are both slower than
> gcc4 which is infamous for being slow at compiling code, and
> yes this is with a release build/--enable-optimizations.
>
> This seems to go against notes such as
> http://clang.llvm.org/features.html#performance
> which claim clang is signifcantly faster than gcc.
>
> Below are some times and the larger object files when
> compiling an i386 OpenBSD kernel at -O2 on an Intel Atom
> based laptop. The significantly larger code size
> is rather disturbing as it means binaries can't fit on
> space constrained installation media for example.
>
> As the large object files appear with both llvm-gcc
> and clang it would appear to be a problem with
> the X86 backend. Is this the expected behaviour at
> this point? There is quite a difference in code size
> between llvm based compilers and pure GCC ones.
>
> I'm happy to supply more configuration/object size details
> if someone is interested.
>
> =========================
>
> clang 20070717 svn --enable-optimizations
> text data bss dec hex
> 7412287 160516 1049460 8622263 8390b7
> 19m4.11s real 16m56.35s user 1m44.23s system
>
> -rw-r--r-- 1 jsg wsrc 122K Jul 18 01:41 if_spppsubr.o
> -rw-r--r-- 1 jsg wsrc 127K Jul 18 01:36 aic79xx.o
> -rw-r--r-- 1 jsg wsrc 130K Jul 18 01:46 pci_subr.o
> -rw-r--r-- 1 jsg wsrc 161K Jul 18 01:38 bwi.o
> -rw-r--r-- 1 jsg wsrc 349K Jul 18 01:47 isp_pci.o
> -rwxr-xr-x 1 jsg wsrc 7.9M Jul 18 01:54 bsd
>
> =========================
>
> gcc 3.3.5
>
> text data bss dec hex
> 6358820 182268 1051044 7592132 73d8c4
> 14m7.04s real 13m5.64s user 1m15.96s system
>
> -rw-r--r-- 1 jsg wsrc 85.2K Jul 18 02:25 isp.o
> -rw-r--r-- 1 jsg wsrc 97.5K Jul 18 02:26 bwi.o
> -rw-r--r-- 1 jsg wsrc 100K Jul 18 02:24 aic79xx.o
> -rw-r--r-- 1 jsg wsrc 124K Jul 18 02:32 pci_subr.o
> -rw-r--r-- 1 jsg wsrc 350K Jul 18 02:32 isp_pci.o
> -rwxr-xr-x 1 jsg wsrc 6.9M Jul 18 02:38 bsd
>
> =========================
>
> gcc 4.2.4
>
> text data bss dec hex
> 6373332 169212 1051044 7593588 73de74
> 17m49.36s real 16m44.82s user 1m15.59s system
>
> -rw-r--r-- 1 jsg wsrc 98.6K Jul 18 02:00 aic79xx.o
> -rw-r--r-- 1 jsg wsrc 99.3K Jul 18 02:02 bwi.o
> -rw-r--r-- 1 jsg wsrc 124K Jul 18 02:09 pci_subr.o
> -rw-r--r-- 1 jsg wsrc 351K Jul 18 02:10 isp_pci.o
> -rwxr-xr-x 1 jsg wsrc 6.9M Jul 18 02:17 bsd
>
> =========================
>
> llvm-gcc 4.2.1 svn 20090717
>
> gcc version 4.2.1 (Based on Apple Inc. build 5646) (LLVM build)
>
> ld -Ttext 0xD0200120 -e start -N --warn-common -S -x -o bsd ${SYSTEM_OBJ} vers.o
> text data bss dec hex
> 7235924 179256 1053092 8468272 813730
> 18m4.05s real 16m35.42s user 1m35.06s system
>
> -rw-r--r-- 1 jsg wsrc 118K Jul 18 01:12 if_spppsubr.o
> -rw-r--r-- 1 jsg wsrc 124K Jul 18 01:16 pci_subr.o
> -rw-r--r-- 1 jsg wsrc 125K Jul 18 01:07 aic79xx.o
> -rw-r--r-- 1 jsg wsrc 159K Jul 18 01:09 bwi.o
> -rw-r--r-- 1 jsg wsrc 349K Jul 18 01:17 isp_pci.o
> -rwxr-xr-x 1 jsg wsrc 7.8M Jul 18 01:24 bsd
> _______________________________________________
> 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