Did you make the same observation when you went from 1 to 2 threads, or just from 2 to 4 threads?
Going from 2 to 4, this would be expected. Because hyperthreading just allows two threads to use the same computing units at the same time. This can be more efficient when one thread stalls out – for example when it has to wait for some data to be read from memory before it can continue. Without hyperthreading, the core would be twiddling its thumbs for a few clock cycles. With hyperthreading, the other thread can take over full time until the other thread can resume working.
So if your code is running without any stalling issues, hyperthreading doesn’t give you any performance benefits.
Latest Answers