mrannony :
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.
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.