How to Speed Up Linux Kernel Compilation

Linux Kernel Compilation speed up command

Well I am not expert but from my experience:

  • set -J parameter same as your processors if you have 8 then make it

    8, you can check from 'cat /proc/cpuinfo'
  • If its virtual machine make sure you have hyper enabled and

    virtual machine is using more than one physical cpu core
  • Dont use toolchain and try to compile at the same target

    architecture (i.e. if its amd64 then compile at amd 64 bit

    machine)

**EDIT:
(Update from Andy comment) Check ccache and how its used in kernel compilation: http://linuxdeveloper.blogspot.de/2012/05/using-ccache-to-speed-up-kernel.html

Additional note: Also make sure you squeeze your CPU enough https://askubuntu.com/questions/523640/how-i-can-disable-cpu-frequency-scaling-and-set-the-system-to-performance

How to speed up compilation time in linux

I use a non-recursive build system based on GNU make and I was wondering how well it scales.

I ran benchmarks on a 6-core Intel CPU with hyper-threading. I measured compile times using -j1 to -j20. For each -j option make ran three times and the shortest time was recorded. Using -j9 results in shortest compile time, 11% better than -j6.

In other words, hyper-threading does help a little, and an optimal formula for Intel processors with hyper-threading is number_of_cores * 1.5:

Sample Image

Chart data is here.

How to speed up android build system

By referring build/core/Makefile, It shows that, we can see the sequence of commands running while building by passing SHOW_COMMANDS=1 while building Android as below,

SHOW_COMMANDS=1 V=1 make bootimage -j1 -n >bootimage.txt 

From this we can extract the commands which are necessary for our case, and we can put into a script to build. eg, bootimage.sh



Related Topics



Leave a reply



Submit