4 ms·
Actually things are not as bad as they used to be. Since 3.4 you can alter the way multiprocessing starts processes: https://docs.python.org/3/library/multipro
by hyperbovine 9y ago
Actually things are not as bad as they used to be. Since 3.4 you can alter the way multiprocessing starts processes:
https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods https://docs.python.org/3/library/multiprocessing.html#conte...
The ``forkserver`` method eliminates most of the problems you mention: child processes are only started once, and they fork() from a totally separate process so they don't inherit all of the resources of the main process (in particular, they don't copy the whole heap). I've found this eliminates 90% of the performance-related issues I used to experience with multiprocessing.