These cmds sometimes overpower the available memory and I have been forced to increase my swap size to avoid Out of Memory (OOA) errors.
Running out of swap space (or having to increase your swap size) tells me you're running too many processes at once.
My question is: generally, will my (or any) program complete faster by reducing threads and increasing swap space or increasing threads and reducing swap space (or is there a "sweet spot")?.
The two options don't really make sense. If you increase the number of threads (and therefore RAM required) and at the same time reduce your swap size, you'll probably run out of memory (stored in both RAM and swap), causing processes to be terminated by your operating system and/or memory allocation to fail.
Running out of RAM causes your operating system to free some up by writing memory to disk (swap space). This is a relatively time-consuming task, so you really want to avoid using more memory than you have available in your RAM.
I would limit the number of processes so you don't run out of RAM, to avoid writing memory to disk. Check the available memory with
psutil.virtual_memory().available before starting another process. Having 1GB before starting another seems reasonable.
You should do some benchmarking - time how long it takes to complete a variety of different source files, with different values for max processes, and min memory before starting another.