Re:How many CPU cores can you use in parallel?
by dr_kiszonka on Tuesday December 19, 2023 @03:26PM
(#38701020)
PythonSpeed is one of my favorite websites. However, this article leaves me with more questions than answers. (I do appreciate the benchmarking code.) For example, at one point, the author mentions that hyper-threading can be disabled in BIOS. Should I disable it? Based on the author's own description, it sounds like hyper-threading is pretty useful.
[ Parent
| on HN ]
Re:How many CPU cores can you use in parallel?
by duohedron on Tuesday December 19, 2023 @03:50PM
(#38701340)
When I wrote some parallel code in C, enabling hyper-threading resulted only 30% increase in speed, which not too little, but you would expect more for doubling the thread count. I don't remember what was the bottleneck, but it was not I/O.
On an other occasion a consultant for a HPC consultant advised us to disable some physical cores for the optimal performance of a geological simulator application, because the core/cache ratio is higher that way.
Re:How many CPU cores can you use in parallel?
by gpderetta on Tuesday December 19, 2023 @08:19PM
(#38704363)
30% increase in performance from hyperthreading is impressive.
Re:How many CPU cores can you use in parallel?
by owlbite on Tuesday December 19, 2023 @03:47PM
(#38701303)
Like much of the advice "it depends" and "measure it".
Basically hyper-threading shares a whole load of resources between threads. If your code ends up contending on those resources you probably run slower. If your code is blocked due to lack of instruction-level parallelism, it probably runs faster. Generally an expert-optimized numerical code (e.g. machine learning) is going to fall into the first camp as it's pretty easy to kill the ILP bottlenecks in that sort of code.
Re:How many CPU cores can you use in parallel?
by IshKebab on Tuesday December 19, 2023 @04:02PM
(#38701493)
No. It's a performance optimisation and generally makes things faster. The only reason to disable it is because of Spectre security stuff.
Re:How many CPU cores can you use in parallel?
by CyberDildonics on Tuesday December 19, 2023 @04:20PM
(#38701768)
No. It's a performance optimization when there are more threads than physical cores because it helps hide memory latency behind threading.