Optimising GCC

This project, as part of Google Summer of Code 2011, is about optimising GCC in both CPU and memory utilisation. Instead of only targeting a specific part, this project also includes profiling the whole codebase to find the hotspots, which could be split in many parts of the compiler or inside data structures used in many places. Even though GCC's runtime is already almost evenly split, gathering small gains from many parts will hopefully result in a noticeable result.

Emphasis, at least in the beginning, will be given on improving non-optimising builds (-O0 -g3) which are the most frequent for a developer's work flow. Later on, time spent on optimising passes (-02) will be measured and g++ specific optimisations will be considered near the end of this project.

Interesting links:

This page will be holding notes regarding the ongoing project of GCC optimisation.

How to find hotspots

Optimise What?

various TODO

Benchmarking Methodology

~/dist/src/gcc-4.6.0-mine/configure --enable-languages=c --disable-bootstrap --disable-plugins --disable-multilib \
CFLAGS="-O2 -g3 -march=i686 -mtune=generic -fno-inline -fno-inline-small-functions -fno-indirect-inlining -fno-inline-functions" \
BOOT_LDFLAGS="-static -L/home/jimis/dist/opt/tgt-glibc-2.13/lib" \
LDFLAGS="-static -L/home/jimis/dist/opt/tgt-glibc-2.13/lib" \

make -j4 BOOT_LDFLAGS="-static -L/home/jimis/dist/opt/tgt-glibc-2.13/lib" LDFLAGS="-static -L/home/jimis/dist/opt/tgt-glibc-2.13/lib"

make prefix=/home/jimis/dist/opt/tgt5e-gcc-4.6.0-noinline-static/ install

Profiler output (compiling kernel's tcp_ipv4.c with -O0 -g3)

real    0m6.823s
user    0m6.524s
sys     0m0.297s

real    0m6.712s
user    0m6.400s
sys     0m0.309s

None: OptimisingGCC (last edited 2012-03-18 20:00:50 by 147)