0

I read something about hyperthreading and found out how beneficial it is for performace. I know the idea is something like when 2 disjoint processes on core are going to execute, in hyperthreading it can be executed in the same time. I also know, that hyperthreading is using some magic with spliting core to 2 virtual ones.

But imagine this situation. I have some basic python script doing some maths. Its 1 threaded process and can push core to 100% for a long time. Its always doing the same, so it cannot use hyperthreading best feature to execute in same time. What will be the difference in performance in HT on and off? In ht on, will i have only 50-60% of the proccess performance or close to 100%?

My example: I have 2 cores(4 threads), and im running 1 program on 100%, windows manager is showing around 32-33% cpu used by that process. I also try it with Process Explorer, there i see its capped with 25% on that process.So, if i dont have HT on, it will be 50%. But im now not sure, if im using only half of the core power, or its showing wrong numbers or whats over. I need some explanation.

  • Possible duplicate of [Single-CPU programs running on Hyper-Threading-enabled quadcore CPU](https://stackoverflow.com/questions/10709442/single-cpu-programs-running-on-hyper-threading-enabled-quadcore-cpu) – Daniele Cappuccio Apr 20 '18 at 14:11
  • it's hard to know without knowing what you're running, just test it yourself – JDong Apr 20 '18 at 14:12
  • i mean something like sorting over and over again, or adding, multiplying values... i cannot disable HT by default, so its more like hypothetical question – Juraj Karlubík Apr 20 '18 at 14:48

1 Answers1

0

Python does not allow taking advantage of processor parallelism except for some special cases (like numpy, gzip and other C extensions). For more information, read about the GIL.

HT will not change anything unless your system has other things running as well.

PS: You can test and measure this!

Javier
  • 2,752
  • 15
  • 30