Wednesday, December 26, 2012

How Many Parallel-Make Jobs Should I Use?


Before I start a really large build, collecting some more timing info seems worth a moment's work.

GNU make lets me do parallel builds, with make -j <Njobs>, so I'd like to know how big to make Njobs on my netbook.  Too few, and I'm not taking advantage of the feature.  Too many, and I may end up thrashing.

Building the bootloader's pretty fast, so I'll instrument just that build and run it with different "j" values.

== 1 ==
[ 10:56:14 ] : == ./time-parallel-bootloader-builds: BEGIN
[ 10:59:38 ] : == ./time-parallel-bootloader-builds: SUCCESS
== 2 ==
[ 10:38:28 ] : == ./time-parallel-bootloader-builds: BEGIN
[ 10:41:02 ] : == ./time-parallel-bootloader-builds: SUCCESS
== 3 ==
[ 10:41:02 ] : == ./time-parallel-bootloader-builds: BEGIN
[ 10:43:34 ] : == ./time-parallel-bootloader-builds: SUCCESS
== 4 ==
[ 10:43:34 ] : == ./time-parallel-bootloader-builds: BEGIN
[ 10:46:06 ] : == ./time-parallel-bootloader-builds: SUCCESS

Looks like make -j2 is the winner -- it's better than make -j1, and no worse than make -j3.  (I even re-ran make -j1, just to make sure it wasn't slower because the filesystem cache hadn't been loaded up with the bootloader sources.)

No comments:

Post a Comment