To speed up compilation, you should create object files in tmpfs rather than a rotational hard disk. Since source files are cached in memory too, it is safe to assume that you are CPU bound (assuming you have enough RAM). If you have other laptops/desktops, I recommend to add them to a compiler cluster for improved build times. Compilation can often be parallelized.
As for the hardware:
- Pick a SSD to store the OS and source files, this should reduce startup times (the time that is needed to read the sources into the filesystem cache).
- Pick at least 8 GB RAM, 16 GB or more is recommended. I managed to finish a buildroot build with all source and object files on a 16GB tmpfs.
- Focus on the CPU, the more cores/threads, the better.
Benchmarks (time in seconds, three trials without other significant processes running, standard deviation between parentheses,
-jN indicates number of parallel units):
CPU C/T RAM -j4 -j8 -j12 -j16
i5-460M 2/4 8 GB 337 (1.28) 344 (1.04)
i5-2320 4/4 24 GB 163 (2.35) 158 (0.20) 159 (0.50) 159 (0.33)
i7-3770 4/8 24 GB 133 (0.31) 110 (0.15) 108 (0.06) 109 (0.26)
distcc (100 Mbit LAN, node -- router -- node)
-j20 (priority: remote i7-3770 16, local i5-460M 4): 186 (7.36)
-j20 (priority: local i5-460M 4, remote i7-3770 16): 184 (1.40)
-j20 (priority: local i7-3770 16, remote i5-460M 4): 104 (2.26)
-j24 (priority: local i7-3770 16, remote i5-460M 8): 101 (1.24)
C/T = Cores/Threads, -j12,-j16 were skipped for i5-460M as that would be very slow anyway.
The time to copy the sources to tmpfs (from SSD) have not been incorporated, the numbers show raw performance for
make bzImage modules (link to benchmark script). No swap file has been used.
The distcc processes appear to be I/O bound when using my laptop as local, while watching vnstat, I found that the TX+RX stuck at around 80 Mbit/s. It is also important to set the local distcc host to localhost (and not the address of the node) as this would otherwise cause a performance drain (for local i7-3770, remote i5-460M, -j20 resulted in 144 (sdev 0.65), that's a 40 seconds performance hit!).