GCC Graphite and Link Time Optimization are new features that many Gentoo users do not enable because they have not been proven to improve performance. I recently did a fresh install of Funtoo optimized for Core i7 and a recompile of the system to run Phoronix benchmarks. Before we look at the benchmarks, it is imperative to note that Phoronix is not intended to test the performance of programs compiled with certain sets of GCC flags. The test suite documentation states,
… for the software being tested that may be installed already on the system by the user, the Phoronix Test Suite will ignore those installations. The Phoronix Test Suite installs all tests within its configured environment to improve the reliability of the testing process.
which means the test suite disables system-wide GCC flags for test packages. So out of the tests I ran, only the ones that tested the packages compiled with Graphite and LTO enabled are worth looking at, and these are PyBench and gzip compression. Of the other tests, video and audio encoding as well as the lzma compression are built using the make command, which bypasses the Gentoo build system. If we look at the individual test packages, the lzma package downloads the lzma source
<!--Phoronix Test Suite v3.0.0a3 (Iveland) [ http://www.phoronix-test-suite.com/ ]-->
and builds it without using Gentoo’s package manager. That means it doesn’t use the GCC optimization flags.
tar -zxvf lzma-4.32.6.tar.gz
make -j $NUM_CPU_JOBS
echo $? > ~/install-exit-status
rm -rf lzma-4.32.6
cat > compress-lzma <<EOT
./lzma_/bin/lzma -q -c ./compressfile > /dev/null 2>&1
chmod +x compress-lzma
On the other hand, the gzip package doesn’t require any downloads and uses the system’s gzip
cat > compress-gzip <<EOT
cat compressfile | gzip -c > /dev/null 2>&1
chmod +x compress-gzip
At last, we are ready to understand the results, which do indicate that these new GCC features improve performance.