[R&D] MYTHBUSTER Optimized compiler toolchains
There are several different cross-compiler toolchains available for building the Android Linux kernel. There is the offical TC released by Google as part of the Android NDK (http://developer.android.com/sdk/ndk/index.html
) as well as several TCs released by third parties which claim to be more optimized for the target platform. While the most popular of these third party TC is the one from CodeSourcerey (https://sourcery.mentor.com/sgpp/lit...al/release1803
), Linaro also offers one TC very popular by developers of custom kernels (http://www.linaro.org/downloads/
) and there also is the Mjolnir TC by redstar3894 and intersectRaven (https://github.com/redstar3894/Manif...er/README.mkdn
I have read of lot of praise for these optimized TC from different kernel developers that all claim that these do much better than the offcial Google TC, however to my knowledge up until now nobody actually took the effort of investigating the effect of the TC and most devs simply assume that a TC marketed as optimized by their creators is actually performing better.
So to investigate the performance of the different TC, I compiled a kernel (GLaDOS kernel for ICS) with the following four different TC:
1. Offical Google arm-linux-androideabi-4.4.3 (part of android-ndk-r7)
2. CodeSourcerey arm-2011.03-41-arm-none-linux-gnueabi
3. Linaro android-toolchain-eabi-linaro-4.6-2011.11-4-2011-11-15_12-22-49-linux-x86
4. Mjolnir arm-eabi-4.6-mjolnir-20111006
Also while I was at it, I investigated the effect of the compiler flags '-fgcse-after-reload' and '-ftree-vectorize' (see https://github.com/Ezekeel/GLaDOS-ne...f32ee#comments
) by compiling a version with the CS TC which did not include these flags.
I performed the following two tests for the kernels:
: Measured the bootup time including a rebuild of the Dalvik-cache after a wipe (2 times).
: Performed a benchmark with AnTuTu Benchmark v2.4.3 including CPU/memory, 2D and 3D graphics (3 times).
CodeSourcerey TC without flags:
Google 1:34 1:34
CS 1:34 1:34
CS-flags 1:34 1:34
Linaro 1:34 1:34
Mjolnir 1:34 1:34
As one can clearly see from the results, the so-called optimized TCs perform not better than the official TC released by Google in any measurable way. So the improvements that some kernel devs have felt cannot be backed up by these data and is most likely wishful thinking. Also note that the compiler flags '-fgcse-after-reload' and '-ftree-vectorize' do not have to seem any adverse effects regarding the performance of the kernel.
In case anyone wants to try some benchmark fun for himself, here are the kernels (GLaDOS kernel for ICS).