Jump to content

Hyperthreading in optimzed vs. non-optimized applications

Yasashii

Hello.

 

I've got a certain conundrum and met with very varying opinions on the subject.

 

If I have a 6-core CPU that supports Hyperthreading, and an application that only supports paralleling its operation to 6 threads, will it make any difference if I turn hyperthreading off, so that it can use each individual core as its own entity, or will its performance be decreased because the application will only use 6 threads of the 12 available if I leave hyperthreading on?

 

Some say that it will hurt performance because L1 and L2 caches will be divided for the 2 threads, but not otherwise. Others say it will slice the performance in half because the application would only use half of each core in this scenario. There are those who say that there is no appreciable difference.

 

Can anyone shine some more detailed light on the subject?

 

Thank you.

Link to comment
Share on other sites

Link to post
Share on other sites

if you turn off hyperthreading cpu (usually) turbo to a higher frequency therefore better single core performance  

about cache idk

if it was useful give it a like :) btw if your into linux pay a visit here

 

Link to comment
Share on other sites

Link to post
Share on other sites

It depends on the software and OS.

 

I run compute tasks that generally show no benefit from SMT, and optimal performance is reached running one thread per core. If between the software and Windows, running at one thread per core even with SMT on gets a good result. Sometimes, Windows may be stupid for example and put two threads on one core, leaving another core idle. That is not optimal and will result in loss of performance. The workarounds to that are either to manually set affinity, or turn off SMT.

 

I have a 12 core CPU I'm using for gaming. Something silly is going on with that too. Since games don't scale to 24 threads, I turned off SMT on that, so it is now a 12 core 12 thread CPU. Games run better than before. Each thread now gets the full resources of a core, and don't have to fight with each other for shared resources.

 

Note that in general SMT gets more things done faster, but it doesn't necessarily get a single thing done faster. If that single thread is critical path, it can be slower overall.

Gaming system: R7 7800X3D, Asus ROG Strix B650E-F Gaming Wifi, Thermalright Phantom Spirit 120 SE ARGB, Corsair Vengeance 2x 32GB 6000C30, RTX 4070, MSI MPG A850G, Fractal Design North, Samsung 990 Pro 2TB, Acer Predator XB241YU 24" 1440p 144Hz G-Sync + HP LP2475w 24" 1200p 60Hz wide gamut
Productivity system: i9-7980XE, Asus X299 TUF mark 2, Noctua D15, 64GB ram (mixed), RTX 3070, NZXT E850, GameMax Abyss, Samsung 980 Pro 2TB, random 1080p + 720p displays.
Gaming laptop: Lenovo Legion 5, 5800H, RTX 3070, Kingston DDR4 3200C22 2x16GB 2Rx8, Kingston Fury Renegade 1TB + Crucial P1 1TB SSD, 165 Hz IPS 1080p G-Sync Compatible

Link to comment
Share on other sites

Link to post
Share on other sites

Core binding is the key here. If you can pin each thread of your program on each physical CPU, then do it. If you can't, then you will rely on the OS scheduler. Check if each CPU core has a load. It doesn't matter if some threads are on the logical cores as long as the corresponding physical cores are idle.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×