5 ms·
I have a gigantic difference in execution time between the two. Also, you can have the same behavior importing contextlib.closing; from multiprocessing imp
by bigd 13y ago
I have a gigantic difference in execution time between the two.
Also, you can have the same behavior importing contextlib.closing;
from multiprocessing import Pool
from contextlib import closing
with closing(Pool(15)) as p
p.map(f, myiterable)
takes <30 sec vs
from concurrent.futures import ThreadPoolExecutor as Pool
with Pool(15) as p
p.map(f, myiterable)
that takes > 1min.
whereas ProcessPoolExecutor hangs, and I've no clue why.