Advertisement

Hyperthreading benefit for fully conccurent tasks

Started by February 26, 2010 05:40 PM
2 comments, last by frob 14 years, 8 months ago
I have been having some difficulty finding data on the benefit of the hyperthreading features of the i7. The idea of having eight logical cores to play around with, especially for fully concurrent algorithms is exciting; but I wonder about the cost/benefit ratio when comparing to the much more economic Phenom II; as well as whether or not the idea makes sense. I'm no chip designer, but assuming a hypothetical situation where you have two CPUs, one with four cores, and the other identical, but without hyperthreading; will hyperthreading truly result in an increase in speed? (Assume a process that does not involve disk access and is working exclusively on data in the cache... ultrahypothetical) The other question I have with hyperthreading, and this might be ignorant n00bishness, but by having 8 logical cores, will you get any more cache thrashing? This might be less of an issue on say, a single app utilizing eight threads; but if you have eight apps each running on their own thread I can see this actually hurting performance. I have several pieces of code now optimized for N cores and would like to take more advantage of them; so I am trying to make the decision between building a fancy i7 based system or saving some money and building an i5 or Phenom II box. On another note, anyone here built a cluster? I am doing some non-realtime rendering and would like to spread it across multiple boxes if possible; but my code base is C#; and have no idea where to begin on this sort of project.
Quote: Original post by djz
by having 8 logical cores, will you get any more cache thrashing?
Yes, you certainly do, but funnily, this is not a bad thing. The way hyperthreading works, cache misses are a lot less severe than on a non-hyperthreaded machine.
Normally, if you have a cache miss, the CPU can execute instructions that do not depend on this data out of order to some extent, but that's it. Other than that, it will just block and do nothing.
On a hyperthreaded machine, it will instead make 100% of the CPU's resources available to the other thread. Normally, that is in absence of cache misses, the other thread only leeches on the resources that are incidentially unused. This means that performance is not so great if you look at that thread alone, but overall, the resource usage is better, and you get more performance out of it overall.
A non-hyperthreaded CPU may typically use something like 60-70% of its units at a time, whereas a hyperthreaded one may typically use upwards of 90% (and close to 100%) at most times.
Advertisement
Get the best of both worlds and get a 1156 mobo and a core i7 860. The i5 & i7 processors also have a feature (Turbo Boost) that will overclock the CPU automatically if your application is primarily using one or two cores.
The pros and cons of hyperthreading have been studied by review sites for years. Google.

If you are concerned about the i7 core, try this part of a 7-piece article that compares the processor with and without hyperthreading.

Read the other articles in the series for additional interesting results. They talk about several different processors in various configurations and how they all relate.

Ultimately it boils down to what your programs are actually doing. If your processing is data-intensive (especially if it pulls everything from disk) then ANY extra processor can hurt you.

As an example, we have automated build machines. The scripts are configured to automatically spawn threads based on the number of processors on the machine. When some 8-core build servers were installed we noticed that code builds were much faster, but data builds on the machines moved from about 15 minutes to nearly two hours. The bottleneck for data builds was I/O, not processing, so the extra processors had a side effect of just clogging the bottlenecks even worse.
Here's an ExtremeTech article with similar findings.

Different combinations of concurrent applications perform radically different with HT on or off.

The performance is ultimately up to the specific applications and how they interact with the system, and less about the general physical hardware.

This topic is closed to new replies.

Advertisement