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
:
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
Difference Between Unix Domain Stream and Datagram Sockets
How to Print Only the Hex Values from Hexdump Without the Line Numbers or the Ascii Table
Does Linux Kill Background Processes If We Close the Terminal from Which It Has Started
How to Add My Own Software to a Buildroot Linux Package
What Happens After a Packet Is Captured
Pass Parameter to an Awk Script File
Detect the Presence of a Device When It's Hot Plugged in Linux
Error: "Grep: Argument List Too Long"
Preserve Colouring After Piping Grep to Grep
Managing User Configuration Files Across Multiple Computers
Linux: Merging Multiple Files, Each on a New Line
How to Install Maven into Red Hat Enterprise Linux 6
/Lib64/Ld-Linux-X86-64.So.2: No Such File or Directory Error