As I were compiling wireshark, I thought about how much you could speed up a compile, by using multiple cores, which most computers have nowadays.
Now, to use multiple cores/cpus to compile something, simply use the -j flag with make, like this make -j 4 which would cause the make program to use 4 cores, or more precisely, it will make the make utility spawn 4 compiler instances.
So how much does that help? well, I timed the compile time for wireshark, using 1 to 4 cores:
$ time make -j 1
(other output)
real 13m16.750s
user 11m26.180s
sys 1m34.690s
$ time make -j 2
(other output)
real 7m1.180s
user 11m14.050s
sys 1m31.640s
$ time make -j 3
(other output)
real 5m11.904s
user 11m7.480s
sys 1m27.630s
$ time make -j 4
(other output)
real 4m20.934s
user 10m49.290s
sys 1m22.190s
As you can see, it doesn’t scale linearly, but I think that typing in -j 4 is worth the 305% speedup it gives.
Related posts:
- Compiling wireshark from source on Ubuntu 9.10
- Speeding up multiple SSH connections to the same host
Tags: development, howto, linux




