You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Potential performance regression with Python 3.14 bench_mp_pool on Linux #139881
Maybe it's because we are changing the default start method? we switched from fork to forkserver on Linux in Python 3.14. Could you try to alter the benchmark and explicitly call multiprocessing.set_start_method("fork") to see what happens? (I don't know where you should put that call though...)
We don't see that much drop of performance on bench_mp_pool on the main branch:
@LamentXU123 That's not a comparison between 3.14 and 3.13.
Yeah, that's basically what @LamentXU123 has posted above #139881 (comment), but it got hidden. Looking what happened around that time in September it must have been #135295 (commit 0912b3a) that cured it. @thesamesam already mentioned the related issue #126631.
#137996 got closed as duplicate of this issue, so most probably this issue here can be closed as duplicate as well?
Since the associated PR got also backported to 3.14 #138607 (commit 64f0e2d) and thus will be part of 3.14.1.
And it was also backported to 3.13 #138609 (commit 9a6137a) and is part of 3.13.8 and 3.13.9. It had less effect on speed there, since, as mentioned above, the default start method on 3.13 is still fork. I am quite confident, that 3.13 without that fix would show worse performance for forkserver as well?
The default start method change was intentional and long planned. I don't think it is very useful for that benchmark to focus on the default start method. Explicitly benchmarking each one is a more interesting comparison.
Activity
LamentXU123 commentedon Oct 10, 2025
picnixz commentedon Oct 10, 2025
Maybe it's because we are changing the default start method? we switched from fork to forkserver on Linux in Python 3.14. Could you try to alter the benchmark and explicitly call
multiprocessing.set_start_method("fork")to see what happens? (I don't know where you should put that call though...)@LamentXU123 That's not a comparison between 3.14 and 3.13.
NoAnyLove commentedon Oct 11, 2025
@picnixz I think you're right, 3.14 matches 3.13 after adding
multiprocessing.set_start_method("fork").btw, I'm running benchmarks on a small Ubuntu VM with a few cores, 3.14 is only a few times slower than 3.13.
Without
multiprocessing.set_start_method("fork"),With
multiprocessing.set_start_method("fork"),thesamesam commentedon Oct 12, 2025
Two issues w/ forkserver, but it may be distinct from these:
picnixz commentedon Oct 12, 2025
@gpshead Was such slowdown actually planned or is it a legitimate issue somewhere?
eendebakpt commentedon Oct 27, 2025
The PR introducing the slowdown is #101556. But according to the python speed center python 3.15 will have a speedup again:
chris-eibl commentedon Oct 30, 2025
Yeah, that's basically what @LamentXU123 has posted above #139881 (comment), but it got hidden. Looking what happened around that time in September it must have been #135295 (commit 0912b3a) that cured it. @thesamesam already mentioned the related issue #126631.
#137996 got closed as duplicate of this issue, so most probably this issue here can be closed as duplicate as well?
Since the associated PR got also backported to 3.14 #138607 (commit 64f0e2d) and thus will be part of 3.14.1.
And it was also backported to 3.13 #138609 (commit 9a6137a) and is part of 3.13.8 and 3.13.9. It had less effect on speed there, since, as mentioned above, the default start method on 3.13 is still
fork. I am quite confident, that 3.13 without that fix would show worse performance forforkserveras well?thesamesam commentedon Nov 22, 2025
#86354 (pending PR #139537) could have a performance impact as well.
gpshead commentedon Nov 22, 2025
The default start method change was intentional and long planned. I don't think it is very useful for that benchmark to focus on the default start method. Explicitly benchmarking each one is a more interesting comparison.
gpshead commentedon Nov 22, 2025
anyways I agree that we can close this as (a) it was planned and (b) the bugfix for
__main__preloading being in 3.14.1 happens to make it happier.