it’s the first time I use LLVM (at least knowing it) and I noticed that the LLVM Integrated Tester (LIT) used 4 cores CPU cores on my laptop having an Intel i7-4600U CPU with only 2 physical cores (which gets to 4 counting the virtual cores created by hyperthreading).
Usually, for processes where the CPU is the bottleneck the faster option is to use a number of threads no more and no less than the number of physical cores (not the total one including the virtual cores).
The default number of cores for the tests gets calculated here:
The best way I could find for obtaining the number of physical cores using Python is:
import psutil psutil.cpu_count(logical=False)
For which python-psutil should be added to the dependencies list.
psutil is multiplatform, which means that all the indicated code block can be replaced by its usage.