Running Python 3.6.4 (64 bit) on Windows 10, AMD Threadripper 16 core CPU, 64 GB RAM, fast SSD. Nothing else is running (<2% CPU) or using RAM (55GB Free) before I start this test. Everything runs fast except calling mp.Pool() to setup the worker processes. Once setup, running pool.map() is fast as expected. Notes: Running local and tested with and w/o virtual env.
Any fixes, workarounds, ideas or explanations would be appreciated. Thanks.
import multiprocessing as mp
import time
for x in range(2,15):
t0 = time.perf_counter()
with mp.Pool(processes=x) as pool:
pass
print('Done {0} processes in {1:.2f}s'.format(x, time.perf_counter() - t0))
Done 2 processes in 0.79s
Done 3 processes in 1.34s
Done 4 processes in 2.18s
...
Done 12 processes in 6.44s
Done 13 processes in 5.45s
Done 14 processes in 5.73s