Based on my experience, hyper threading was anyway a workaround until multicore became widely available, not sure how much it is still worthwhile, given the impact in shared units across the CPU.
Usually having hyperthreads killing each other's cache entries, is much worse that splitting the work across multiple real cores, with a few synchronisation points.
Hyper-threading is a way to make better use of the execution engines of a CPU core. Some instructions stall (for example, because they need to wait for memory), so you want to run something else in the mean time. Instruction reordering and speculative execution only goes so far. If you have a completely separate thread available that can do some useful work, then you improve the overal efficiency.
Note that GPUs basically are hyper-threaded CPUs that not have just 2 or 4 threads per core, but thousands. This approach avoids needing all the complicated out-of-order circuitry, but it only works if you really have thousands of threads, which for a GPU is actually the case.
Back in 2010 I disabled hyperthreading on development machines, due to decrease in performance on Java and .NET application servers.
They were much faster using only real cores.
So maybe my experience is tainted due to the runtimes not being written in a way that they could take advantage of hyperthreading, however I have my doubts it has improved since then, unless the code is aware of being executed in hypethreads and act accordingly.
Hyperthreading's effectiveness really depends on your workload.
Since 2010, a lot more workloads got better at running over more threads (better locking, better balancing across threads, some computations broken up across threads that weren't before) because core counts have gone way up.
CPUs have gotten better at it too, there's less fixed sharing and more dynamic sharing. Used to be if hyperthreading was enabled, L1 caches would be partitioned in half, even if there was only one thread running; same with some other resources. That's how you got really bad performance penalties for unsuitable workloads.
In my recollection, somewhere around 2015, I think it flipped from 'you probably don't want smt enabled (outside of single core), unless you've tested and it's better' to 'you probably want smt enabled, unless you've tested and it's worse'
There's always been workloads that are much better one way or the other, but most workloads are about the same or better with smt these days.
Whether an application gains or loses from SMT depends on what is does.
As a general rule, when there are multiple threads inside a single process, which do the same kind of thing, for example when they process some array and each thread works on some part of that array, enabling SMT frequently degrades the performance, because the threads compete for the same execution units and for the limited space in the cache memory.
On the other hand, when each hardware thread executes a distinct process, which does things uncorrelated with the others, enabling SMT frequently improves the performance.
Typical cases when SMT is beneficial are servers accessed simultaneously by many clients, and compiling a big software project, with hundreds or thousands of files.
For me, compiling big software projects is the main thing that is seriously accelerated by SMT, while some CAD/EDA simulations may be slowed down by SMT.
An interesting fact is that there is a traditional advice than says that when compiling on a multi-core or multi-threaded CPU with N threads, it is optimum to set the number of parallel compilation jobs to N+1.
I have verified that this old advice is correct for multi-core CPUs without SMT or with SMT disabled. On the other hand, if you enable SMT on a CPU with N cores, the optimum number of parallel compilation jobs becomes 2*N, not 2*N+1. For instance, on a 16-core CPU, the optimum number of parallel compilation jobs is 17 with SMT disabled and 32 with SMT enabled.
This result is not very surprising, because every additional parallel job introduces overhead, but without SMT an extra thread is useful, because whenever a running thread is stalled, typically waiting for a file to be read, the extra thread can start running instantly. On the other hand, with SMT enabled, there is no need for an extra thread, because whenever one thread is stalled, its sibling thread is accelerated instantly by using the whole core, instead of sharing it.
It can often still be worthwhile to keep SMT enabled (if available), and very often it is for many general use cases, but it definitely depends on the workload.
Modern cores have become exceptionally good at extracting instruction-level parallelism from a single thread, so SMT becomes relatively less useful all else being equal. At the same time, modern cores also have much wider and more numerous internal resources where a single thread will be more likely to leave more of these resources idle (which could be useful to another simultaneously executing thread).
It seems that if you have two threads that tend to each saturate or bottleneck on the same internal CPU resources (execution resources, various buffers, caches, etc.), then SMT is more likely to reduce overall performance compared to just running a single thread at a time sequentially. But you need to measure to be sure.
As a fun anecdote, one of the best relative improvements I've seen in leaving SMT enabled (vs. disabled) was on one of the earliest (in-order!) Intel Atom CPUs. I suppose getting good ILP out of a single thread was simply not possible there, so even with the tiny execution resources available in that CPU there was still plenty to allow another thread to benefit from substantially.
Hyperthreading was also a workaround for software that did all its networking by leaving hundreds (or even thousands) of OS threads blocked on IO.
As epoll/kqueue/iocp/io_uring et al have become more widely adopted, and we offload a lot more of this IO multiplexing into userspace, the value proposition gets hazier.
A thread blocked on IO gets taken off the CPU by the operating system though, so it isn't "running" as a thread on the CPU, and it isn't using up any resources in this context that might be contending with another SMT thread (other than maybe things like leftover TLB entries or cache lines that become much more likely to just get evicted soon anyway).
In some sense you can think of SMT as a lower-level resource sharing capability (of execution units and various buffers and such) inside the CPU core, which is somewhat analogous to how the operating system shares the higher-level logical CPU by timeslicing access to it across different runnable threads. The latter capability also layers on top of the former, which makes for some interesting performance implications from an operating system scheduler's point of view, but they're still different things.
Doesn't HT help mask cache latencies if your code is very cache-unfriendly? Ie there is computing that can move forward whilst the memory system is waiting?
Usually having hyperthreads killing each other's cache entries, is much worse that splitting the work across multiple real cores, with a few synchronisation points.