Welcome to thatlinuxbox.com Thursday, November 21 2024 @ 01:39 PM UTC
Improve compile time on multi-core Linux systems
- Friday, February 12 2010 @ 08:51 PM UTC
- Contributed by: Dan Stoner
- Views: 5,040
While compiling a piece of software from source the other day, I noticed that my CPU was only at about 50% utilization. This reminded me that the build tools can be set to execute multiple operations simultaneously.
The CONCURRENCY_LEVEL environment variable is used by many tools to determine the number of concurrent jobs to run:
export CONCURRENCY_LEVEL=3
It is also possible to tell "make" directly how many simultaneous jobs to run:
make -j 3
make --jobs=3
On a sample dual-core system, this improved my emacs compile time from 2m36s to 1m31s.
The following comments are owned by whomever posted them. This site is not responsible for what they say.