Skip to content

Conversation

emaxx-google
Copy link
Collaborator

@emaxx-google emaxx-google commented Aug 19, 2025

Have a single process pool instead of recreating it every time pass(es)
are to be executed. We only need to make sure to cancel running jobs.

This brings a significant speedup especially for small cases or for late
stages of reductions in general, where it takes just a fraction of a
second to discover a reduction. Now we don't have to pay the price for
initializing the Pebble pool - hundreds of milliseconds - repeatedly.

While empirical measurements show 1.5x-2x speedup, unfortunately
most of it will be "eaten" by the switch to "forkserver" multiprocessing
mode - the latter seems unavoidable to fix occasional deadlocks.

@emaxx-google emaxx-google force-pushed the test-mgr--single-process-pool branch from e6fe607 to 4acdd3a Compare August 26, 2025 00:24
@emaxx-google emaxx-google requested a review from VitaNuo August 26, 2025 00:44
@emaxx-google emaxx-google marked this pull request as ready for review August 26, 2025 00:44
@emaxx-google emaxx-google changed the title test_manager: Don't create pebble worker pool many times multiprocessing: Don't create pool many times Aug 26, 2025
Copy link
Collaborator

@VitaNuo VitaNuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Have a single process pool instead of recreating it every time pass(es)
are to be executed. We only need to make sure to cancel running jobs.

This brings a significant speedup especially for small cases or for late
stages of reductions in general, where it takes just a fraction of a
second to discover a reduction. Now we don't have to pay the price for
initializing the Pebble pool - hundreds of milliseconds - repeatedly.

Empirical measurements show 1.5x-2x speedup for reductions that used to
finished within 20 minutes.
@emaxx-google emaxx-google force-pushed the test-mgr--single-process-pool branch from eb0c5d6 to e7a1fc0 Compare August 28, 2025 14:27
@emaxx-google emaxx-google merged commit 1dc4895 into marxin:master Aug 28, 2025
10 checks passed
@emaxx-google emaxx-google deleted the test-mgr--single-process-pool branch August 28, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants