-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build_all.sh: building csources 5X faster thanks to make -j (#13300)
* build_all.sh: building csources 5X faster thanks to make -j * fix for freebsd * use OS-dependent formula to get number of logical cores * make is an optional dependency
- Loading branch information
1 parent
adc52b0
commit 45a5c64
Showing
1 changed file
with
24 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45a5c64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a big flat list of jobs with no dependency analysis as build.sh has generally been, the make -j job server is more than one strictly needs.
gmake -j
is perhaps more available on Linux thanbash
version > 4.3 released in 2014, but also maybe not on BSDs. The latter provides another easy way to get parallel speed-up via itswait -n
. E.g., the below stripes however many jobs across N cpus (N provided as $1 here):Example usage (if above is saved in
stripen
andchmod
'd) is likeOf course, the above shell logic also shows how one could do a very small C program to orchestrate striping a flat list of jobs across CPUs, and that build is already assuming a C compiler. That would be the most portable approach of all.