The importance of an optimized toolchain is one of the hottest topics in the Android dev world. Many of you might have heard about GCC and Linaro, which are the two biggest projects of this type. GCC is an old hand that was initially releases in 1987, while Linaro is a relatively young player at only four years old.
Let’s first dive into the history of these two projects. As I said earlier, GNU Compiler Collection is old. Over the years, it has been used to compile various projects, including Android. Google decided to use versions 4.6 and 4.7 as their default toolchains, and I would like to focus on version 4.7 in this series of tests.
Linaro was launched in 2010, and it’s been optimized for ARM architectures. And of course, ARM is used in the vast majority of Android-powered smartphones and tablets. You can find Linaro as a toolchain used to compile kernels or whole ROMs, and many developers claim this toolchain is faster and more powerful than GCC.
Inspired by our Developer Admin Pulser_G2, I decided to give this myth a shot and see whether these claims are real. To do this, I first downloaded the AOSP source. I built an aosp_mako-eng target for my Nexus 4 using the default set of prebuilts from Google. After make otapackage, I got 183115481-byte zip file ready to flash. After, I downloaded the Linaro 4.7.4 toolchain and replaced GCC in prebuilts/gcc/linux-86. I performed the necessary changes to set level O3 of optimization. As AOSP supports only prebuilt kernels (without modifications), I built a kernel on my own with Linaro and replaced the kernel in mako-kernel with my own blob.
Below you can see the two resultant archives. As you can see, the Linaro archive is slightly bigger, so this toolchain actually does something to bin and xbin folders. The kernel file itself is also bigger.
But the file size is not the most important thing. Instead, let’s focus on performance. To measure this, I used AnTuTu benchmark. For increased precision, I ran each test three times. As you can see below, the difference is quite big. However, I wouldn’t put too much blind faith in these tests, as the results differed on every test. That said, Linaro was few points better than GCC—but AnTuTu is not that reliable as you may think.
The following tests were performed with 3DMark to see if a toolchain can impact graphics performance. The difference was even more significant than with Antutu. You may gain few FPS with GCC, but overall smoothness is better with Linaro. The score is also a bit higher.
The final test was run using the game Asphalt 8: Airborne. Below you can see two videos of the game running on both toolchains. The first was made with Linaro, while second with GCC. Personally, I think that Linaro feels a bit smoother than GCC, but that may just be the placebo effect since this was not a double-blind test. Both kernels were stock and free from tweaks, overclocking, and any other fancy tweaks to improve the performance.
So is Linaro Better?
Although I was skeptical at first, I must admit that Linaro seems to be a better choice than GCC—at least on my hardware configuration. The OS felt more responsive and faster than when it was built using GCC. However, GCC is still rock solid, so if you require ultimate stability, it may still be the best choice.
In the next episodes, I will try to compare other toolchains such as SaberMod and Linaro 4.8. Please let us know about your favorite toolchains in the comments below. And if you would like us to test any other toolchains, please say so!_________
Join us for xda:devcon 2014. For a limited time, XDA Portal readers get 20% off registration!