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
process: do not poll join() in MultiprocessingProcesss
Based on the initial analysis of Esteve Varela Colominas, the polling
on join() with the fixed 100ms delay incurs a significant performance
penalty, especially for short-lived processes. And since portage is
prone to spawning many of those, the penalty adds up easily.
Instead of pooling proc.join() with a fixed 100ms delay, we now use
the blocking variant of join() started in an executor which we await
in the coroutine.
Before this change:
( cd lib; python3 -m timeit 'import portage.process; portage.process.spawn("true")' )
2 loops, best of 5: 104 msec per loop
After this change:
( cd lib; python3 -m timeit 'import portage.process; portage.process.spawn("true")' )
50 loops, best of 5: 4.45 msec per loop
Bug: https://bugs.gentoo.org/958635
Signed-off-by: Florian Schmaus <[email protected]>
Part-of: #1452Closes: #1452
Signed-off-by: Sam James <[email protected]>
0 commit comments