7 ms·
What workloads benefit enough from HT to justify it in a laptop?
by hedgehog 2y ago
What workloads benefit enough from HT to justify it in a laptop?
- adgjlsfhk1 2y agoMost things (other than highly optimized HPC) benefits a ton from hyper threading. Code that's unoptimized (e.g. everything web/interpreted languages like python/JS) spends all its time chasing pointers which means that your cores are doing a whole lot of nothing. Hyperthreading means that you can run twice as many applications per core which means that while one thread is waiting for data from RAM, the other thread can utilize the execution units. This also helps power consumption since if you can consolidate all the tasks onto fewer cores, you can put the other cores to sleep and save power.
- dumbo-octopus 2y agoThis isn’t really true. In JS, the JIT can optimize many routines to be much more CPU bound than “just pointer chasing” would have you believe. And of course in Python the bulk of your time should be spent in native code. Whether it actually is is a different question.
- gpderetta 2y agoIf a load is intrinsically pointer chasing (as it is the case for a lot of non-compute software), there isn't much an optimizer can do. That's true even for native code.
- dumbo-octopus 2y agoThat may be the case, what I’m contesting is this distinction made between JS/Python and other languages.
- YZF 2y agoI've always thought of HyperThreading as marketing with no substance. I've seen applications run slower with HT turned on (admittedly a long time ago). Does this combination of running two threads that are "poorly" written (i.e. they can't make use of all the execution units) really exist? If you're multitasking applications you very rarely have multiple application simultaneously require a lot of CPU cycles (e.g. you might be switching from a spreadsheet to a browser but not doing heavy work on both simultaneously). If you are running some specific heavy computational workload then likely it's already optimized to fully utilize the cores it is getting and HT can actually get in the way of that.
- bushbaba 2y agoHT is good for shitty code that chooses core count for threading. When it should really be multiples the core count given time spent mostly in IO.
- hedgehog 2y agoThere are server workloads like maybe high concurrency web apps that might benefit. Back in the days of single core CPUs HT made desktops feel a lot better not just because of throughput but (my speculation) because it reduced typical scheduling latency. Antivirus or whatever else was happening in the background was less likely to cause UI jank.
- DeathArrow 2y ago>If you are running some specific heavy computational workload then likely it's already optimized to fully utilize the cores it is getting and HT can actually get in the way of that. You can test that by running Cinebench with and without hyperthreading. In most of the cases hyperthreading does help.
- dagmx 2y agoA lot of rendering benefits from having SMT/HT disabled. Almost every film studio will do so. Having accurate hardware thread counts matter in those scenarios because the renderers will basically peg each core completely , and the risk of having an SMT/HT context switch between them is detrimental. It was often up to a 30% speed decrease when HT was enabled for us in production scenes. Similarly , many games run better without HT. HT primarily benefits scenarios with many smaller jobs without latency sensitivity. Today though, E-cores have largely replaced the need for HT. It’s much easier to send them to an E core and have them done without the extra overhead of HT scheduling and support.
- Hikikomori 2y agoThen those that know that they dont benefit from HT can just not use those cores no?
- hedgehog 2y agoLikely true in some cases but are these the bottlenecks on a laptop? I've never experienced HT on a multicore CPU being more than maybe a 40% increase in throughput and no real help on latency or efficiency. Implementing HT isn't free and doubling the number of active processes halves the per-process cache while doubling the concurrency in the memory controller (or more because less cache). Then there's the scheduler complexity... On the other hand there's the dual efficiency win of adding more E cores with shorter/simpler pipeline and lower clock speeds. Back in the P4 days HT made desktop interactivity much smoother, these days with 8+ core laptops the win is less clear and at least some of the top design teams think it's not worth it.
- adrian_b 2y agoAs a software developer, by far the most imortant advantage of SMT is the reduction in compilation time for big software projects. I have not encountered any other application that benefits so much from SMT as a compilation that uses all available threads. On older CPUs, such as Skylake derivatives, a 25% compilation speed improvement from SMT was frequent. On newer CPUs, e.g. Zen 3 (presumably also on Zen 4, which has a very similar microarchitecture), the benefits of SMT are smaller (due to improved out-of-order execution), but a 20% compilation speed improvement is still frequent. However, doing compilation on a device with Lunar Lake, a CPU with only 4+4 cores, would be a waste of time, so it clearly does not need SMT. On the other hand, doing compilation on a bigger laptop, with an AMD Strix Point 12-core/24-thread CPU or with whatever Arrow Lake CPU will be launched by Intel to compete with it (presumably having much more smaller Skymont cores than Lunar Lake, to compensate for the lack of SMT) would certainly be useful.
- hedgehog 2y agoI've moved to almost entirely remote dev workflow for similar reasons. Out of curiosity how much RAM do you need per build thread?
- adrian_b 2y agoWhen compiling an entire Linux distribution, there are a few outliers, all of which are derivatives of the Google Chrome code base, which may fail when less than 2 GB is available per build thread (e.g. for a 16C/32T CPU with make -j32, 64 GB of DRAM are required). For most other software projects 1 GB per build thread is enough.
- Dylan16807 2y agoHow often do you have more than 4/8 processes being CPU/memory bound at the same time? As far as power, using simpler cores helps a significant amount too.
- ac29 2y agoAccording to comments from Intel, the additional hardware that has to be added for SMT on a P core isnt much smaller than an entire E core. So, they decided it is better to just rely on the E cores for additional multithreaded performance.
- sregister 2y agoI dont think apple silicon supports SMT? Isn't that enough evidence to show at least for mobile parts 4P4E at least has a chance to be interesting? Also some of the graphs appear to show the new Skymont uarch has high perf/w than raptor cove (the previous P core) which is rather impressive in my opinion.
- usrusr 2y agoNothing. When you want more throughput, pick a setup with more cores. HT was good (not that good but still good) when the goal was performance per die area, but now we live in the area of performance per watt. Doubly so when looking at laptops, but also in all other areas except perhaps gaming PCs (but even there, throughput at high wattage will eventually lead to throttling).