How does hyperthreading improve performance

mrannony

Commendable
Nov 4, 2016
27
0
1,530
Both Intel i5s and i7s have 4 physical cores. The only difference between them being hyperthreading. Since both of them have 4 actual core, shouldn
't they perform similar or is my understanding of this matter somehow flawed.
 
Solution
Each thread is what your PC use. 4 cores 8 threads means that basically you have 8 single core apps, no problem. HT means that 2 threads SHARE resources like cache. SO if you have 2 cores HT and 4 cores no HT, apps should run similarly up to shared resources. I3-7100 have 2/4 with 3 MB cache
which means it have 0.75 MB cache per thread. i5-7300HQ 6M Cache is 1.5 MB cache per core

look here
http://cpu.userbenchmark.com/Compare/Intel-Core-i5-7400-vs-Intel-Core-i3-7300/3886vs3893
Each thread is what your PC use. 4 cores 8 threads means that basically you have 8 single core apps, no problem. HT means that 2 threads SHARE resources like cache. SO if you have 2 cores HT and 4 cores no HT, apps should run similarly up to shared resources. I3-7100 have 2/4 with 3 MB cache
which means it have 0.75 MB cache per thread. i5-7300HQ 6M Cache is 1.5 MB cache per core

look here
http://cpu.userbenchmark.com/Compare/Intel-Core-i5-7400-vs-Intel-Core-i3-7300/3886vs3893
 
Solution

ZRace

Commendable
May 12, 2017
521
1
1,360
Hyperthreading allows each CPU core to handle 2 threads parallel, meaning you can theoretically achieve 200% performance. This will however almost never happen, not even in highly parallelized tasks. 30% average performance increase is what people say.
In highly parallelized tasks such as video editing, encoding, etc. you'll gain more than 30% from Hyperthreading, in mainly single-threaded tasks like Office duties and decompression, there won't be any performance gain.

For gaming, the gains heavily depend on how well the game can use the extra threads. Modern games tend to be able to use them quite well, making i7 CPUs a perfect choice for pure high-end gaming.
 

darkguset

Distinguished
Aug 17, 2006
1,140
0
19,460
Generally i7's also carry some extras such as more addressable memory, more PCIe lanes, more cache and depending on the implementation the HT can make a huge difference between the two.

Again depending on the software implementation (if it takes advantage of all the i7's additional features) that can mean from almost no difference in performance between the two to quite a large gap.
 

darkguset

Distinguished
Aug 17, 2006
1,140
0
19,460


You do understand that I was just trying to answer your "question"? and not take part in a debate. I am not trying to prove anything to you. If you are interested in benchmark comparisons there are a bazillion of them around. Just Google it mate and make up your mind on your own.

Here is one for starters so that you don't say we didn't help you:
https://www.extremetech.com/computing/133121-maximized-performance-comparing-the-effects-of-hyper-threading-software-updates

Also from personal experience in BF1 my minimum FPS went from ~80fps to 144+ (upgraded my 3570K to a 3770K). That is just one example that HT helped positively.
 

rgd1101

Don't
Moderator


The link show nothing about extras such as more addressable memory, more PCIe lanes, more cache
And I think the the only different is more cache.
http://ark.intel.com/compare/97150,97128
 


That's all about HT, the only difference is just cache, has always been the case, the I7 clocks higher out of the box, but no additional PCI-E lanes, no additional addressable memory.

You got better results on BF1 as it can use the additional threads that HT offers, that's not in dispute, just the 'facts' that you stated regarding some of the additional functionality.
 
Hyperthreading allows a second thread to use unused parts of the main thread to do useful work.
This added work can never be the capability of the full core. Usually, it is in the 1/3 range.

The extra hyperthreads can be important or not, depending on the game.
Here is an older series of tests with hyperthreading on or off.
The takeaway is that more than 4 threads is not usually helpful to the gamer.
http://www.dsogaming.com/editorial/report-despite-claims-most-pc-games-are-still-unable-to-take-advantage-of-more-than-4-cpu-cores/




 


Similar findings here from 2016, https://www.techpowerup.com/forums/threads/gaming-benchmarks-core-i7-6700k-hyperthreading-test.219417/ the last posts are hinting that BF1 is different and is capable of using more than previous games, which tallies with the 'my i5 is stuttering' threads that we see.
 

spdragoo

Splendid
Ambassador


It depends on the situation.

As far as actual physical characteristics, it's harder with the later generations of Intel CPUs, as they no longer seem to have direct i5-to-i7 comparisons available (i.e. with Skylake & Kaby Lake, the comparable Core i7 CPUs are already clocked faster). So, I had to go back to their 4th-generation (Haswell) CPUs, comparing the i5-4690K (http://ark.intel.com/products/80811) to the i7-4770K (http://ark.intel.com/products/75123):
-- both have stock clocks of 3.5GHz; with Turbo Boost, they will reach 3.7GHz if 3 or 4 cores are in use, 3.8GHz on 2 cores, or 3.9GHz on a single core (these are all physical cores, BTW)
-- both have 256kB of L2 cache for each physical core (which translates to 128kB per thread for the i7 if all 8 threads are used)
-- the i5 has 6MB of L3 cache (essentially 1.5MB per physical core/thread), while the i7 has 8MB of L3 cache (2MB per physical core, or 1MB per thread if all 8 threads are used); note that L3 cache, however, since it's shared between the cores is theoretically available to any core even if the others arent' in use.

Those latter 2 points are where HyperThreading can be a boon or a bottleneck, or may not even have any difference.
-- For single-threaded applications, if the application can utilize the extra 2MB of L3 cache, then the core i7 will run slightly faster than the core i5 (because it doesn't have to wait as much for instructions to be loaded into the cache); otherwise, they'll pretty much run identically
-- For lightly-threaded applications (using 2 to 4 "threads"), both have 4 physical cores with identical speeds & L2 cache. So if the application can use the extra L3 cache in the core i7, the core i7 system will run slightly faster; otherwise, they'll perform identically.
-- Heavily-threaded applications aren't quite the same. There are almost no applications, for example, that actually require a CPU with more than 4 cores/threads. Instead, most of those heavily-threaded applications are coded so that they will run on a 4C/4T (or even 2C/4T CPU like the core i3), but if they detect more threads/cores are available they will take advantage of them. However, this is also where you can run into problems. The amount of L2 cache, for example, is based on the physical cores in the CPU. With HyperThreading, it splits that L2 cache between the 2 threads, so each thread is only getting half the normal amount. If the CPU's ability to process those instructions matches how quickly the L2 cache can be fed the next set, then you see an improvement in performance due to the enhanced parallel processing. If, however, your threads have a lot of "idle" time because they can't be fed the instructions fast enough, then your speed improvement starts going down. Same thing with the L3 cache; if every core/thread is working hard & pulling on the L3 cache, the core i5 is less likely to have idle time, because the amount available per core/thread (1.5MB) is higher than that available to each core/thread in the core i7 (1MB).

In short, HyperThreading doubles the amount of threads that a CPU can handle, but it does so by halving the amount of physical resources each thread has available. This is why it's said that you typically will only average a 30% improvement for the same clock speeds.

This is also why game performance shows less of an effect on this than other resource-intensive apps. Single- or lightly-threaded games see little to no change in performance between core i5 & core i7 CPUs: without utilizing the extra threads available to the i7, its only possible area for better performance is the larger L3 cache (& if the game doesn't even stress the i5's 6MB cache, then the extra 2MB on the i7 has no effect). Newer games over the past few years have seen more of a gap between the Core i5 & core i3 CPUs, since the latter are dual-core CPUs with HyperThreading (2C/4T); with their lower L3 cache (4MB on the Haswells, for example), combined with the lower L2 cache per thread (128kB vs. the full 256kB), they can't quite process the information as quickly.

On the other hand, HyperThreading really shines in 2 areas:
1. Having multiple processes running. Especially with single-threaded applications that don't use a lot of resources apiece, a 4C/8T CPU can have twice as many open applications as a 4C/4T (or 2C/4T) CPU can before it has to start "switching" between applications on each thread...& just as a 2C/4T CPU can have twice as many simultaneous applications as a 2C/2T CPU.
2. Audio & video editing/rendering. These are the applications that primarily love to see lots of cores/threads in their CPUs. Even more so than file compression utilities, you see a lot more benefit from extra cores/threads with video/audio rendering & recording applications, because they've actually been coded to use as many cores as possible.
 

darkguset

Distinguished
Aug 17, 2006
1,140
0
19,460


Sorry mate - you are right. I thought I was answering a different thing (performance/benchmarks) your question was around the CPU features (which I also seem to have gotten wrong!) - cheers!