I decided that it would be interesting to compile a page giving an idea of how long it takes to compile a kernel on various machines. That way if you have a machine that you need to compile a kernel on, you can look at this page and decide how many cups of coffee to make.
Both sets of times below are compiling a standard linux-2.4.19 kernel. Configured with the defualts for everything.
Here's how I do this test. Note that its important that you perform a compile as soon as you untar the source, so that the source is still in the disk cache. Or we could all reboot the machine between untarring and compiling, but, uh, no.
(In /usr/src, with the 2.4.19 source downloaded already...)
tar zxvf linux-2.4.19.tar.gz cd linux-2.4.19 make oldconfig /usr/bin/time -p -o /tmp/dep.time make dep /usr/bin/time -p -o /tmp/bzImage.time make -j 2 bzImage modules
If you have a machine with more than one processor, you can use make -j n .... where n is the number of cpus + 1
Note: the /usr/bin/time -p -o ... etc is to save the output from time into the specified file, and use the same format as bash's built in 'time'. sigh
vendor_id : !GenuineIntel? cpu family : 6 model : 5 model name : Pentium II (Deschutes) stepping : 2 cpu MHz : 300.686 cache size : 512 KB
make dep real 4m57.320s user 3m13.270s sys 0m23.990s
make bzImage real 15m35.728s user 13m59.330s sys 0m44.490s
vendor_id : !GenuineIntel? cpu family : 6 model : 8 model name : Pentium III (Coppermine) stepping : 6 cpu MHz : 800.040 cache size : 256 KB
make dep real 2m25.837s user 1m22.400s sys 0m15.760s
make bzImage real 6m28.837s user 5m29.810s sys 0m30.400s
processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 6 model name : AMD Athlon(TM) MP 1800+ stepping : 2 cpu MHz : 1533.431 cache size : 256 KB
processor : 1 vendor_id : AuthenticAMD cpu family : 6 model : 6 model name : AMD Athlon(TM) MP 1800+ stepping : 2 cpu MHz : 1533.431 cache size : 256 KB
make dep real 0m25.51s user 0m11.35s sys 0m2.16s
make -j 2 bzImage modules real 1m31.36s user 2m32.80s sys 0m13.50s
make -j 3 bzImage modules real 1m41.04 user 2m43.11 sys 0m17.25
processor : 1 vendor_id : !GenuineIntel? cpu family : 6 model : 8 model name : Pentium III (Coppermine) stepping : 10 cpu MHz : 999.551 cache size : 256 KB
make dep real 1m3.073s user 0m55.750s sys 0m7.610s
make bzImage real 3m46.111s user 3m35.930s sys 0m13.440s
make -j 2 bzImage modules real 2m3.80 user 3m47.93 sys 0m14.91
make -j 3 bzImage modules real 2m5.08 user 3m49.75 sys 0m15.03
processor : 0 vendor_id : GenuineIntel? cpu family : 15 model : 2 model name : Intel(R) Xeon(TM) CPU 2.40GHz stepping : 7 cpu MHz : 2400.147 cache size : 512 KB
make dep real 34.02 user 30.44 sys 3.97
make -j 5 bzImage modules real 61.41 user 225.09 sys 13.10
3 pages link to KernelCompilationTimes: