Speeding up builds
Here's a really simple tip if you are using GNU make. You can pass in the -j option to run the build steps in parallel. The default is -j1, i.e. no parallising.
The next question is what's the optimum number of jobs to run in parallel? An experiment on a build reveals:
So there you have it! On a 4-core CPU (Intel Q6600), it's best with -j4 or above. It's interesting that -j4 didn't max out the CPUs, and that you can keep getting good improvements up to at least -j8.
The next question is what's the optimum number of jobs to run in parallel? An experiment on a build reveals:
N | Time |
1 | 6m13s |
2 | 3m28s |
3 | 2m38s |
4 | 2m11s |
5 | 1m59s |
6 | 1m55s |
7 | 1m53s |
8 | 1m49s |
12 | 1m47s |
16 | 1m47s |
So there you have it! On a 4-core CPU (Intel Q6600), it's best with -j4 or above. It's interesting that -j4 didn't max out the CPUs, and that you can keep getting good improvements up to at least -j8.