Most search and clustering commands in USEARCH support multithreading. Multithreading is parallel execution on a single CPU. All threads share the same memory space. For commands that support multithreading, USEARCH will run one thread per CPU core by default. This can be controlled using the ‑threads N option, where N is the number of threads. Performance may be improved by using more
or fewer threads than the number of cores. If USEARCH is sharing a CPU with
other resource-intensive programs, it may be better to set the number of threads
so that the total number of executing threads in all programs does not exceed
the number of cores. Using fewer threads can be faster if
cache contention is reduced, and more threads can be faster if
output is written via a slow network, in which case many threads
may be stalled waiting for output to complete. |