Say we want to compile a large project (say GCC or the Linux kernel) as fast as possible. Does a CPU with hyperthreading capability (say an Intel Core i7) run the compiler any faster with hyperthreading enabled or disabled? Are there any published benchmarks that test this?
My understanding of hyperthreading is that each core can select instructions from two (or more processes). This usually makes the core more efficient since it’s less likely that functional units will be idle. However, there’s potential for a performance penalty since processes running on the same core share resources such as cache and may interfere with one another. Whether or not performance actually increases depends on the workload.
So for a compiler workload, does performance increase? If so, by how much?
Compiling coreutils-8.4 on Ubuntu 8.04 x86
Intel Atom 1.6 GHz with HT enabled:
So Hyper-Threading reduces the run time to 75%, which is equivalent to 33% more processing power. (I ran them twice to ensure that everything is in the memory cache.)
And here is a control experiment to show that
make -j2alone does not improve the speed for compiling coreutils-8.4 on Ubuntu 8.04 x86Single-core Core 2 Quad 2.5 GHz VM (no HT):