Use separate Bundler download and installation workers - #9777
Conversation
58b24f1 to
1f928f3
Compare
78245cf to
9da6fe0
Compare
71f2793 to
14daf5c
Compare
e35b8c0 to
c5d6166
Compare
5605a3a to
36d082b
Compare
|
I reproduced this locally and would like to narrow the scope before merging. On a 10-core macOS arm64 box, cold cache, 94-gem lockfile: at the default settings the split is a wash, 28.57s median before vs 28.68s after (n=6, alternating). With So I would like to take the scheduler change and the Does that work for you, or do you have a measurement that isolates the settings from the scheduler change? What is |
|
That works for me. nproc on my benchmark host was 11. I do not have a measurement that isolates the settings from the scheduler change. I will update the PR to address the feedback and narrow its scope as requested. |
36d082b to
dcc81e7
Compare
dcc81e7 to
8c64620
Compare
What was the end-user or developer problem that led to this PR?
Bundler uses one worker pool for gem downloads and installations. A slow download occupies a slot that could install an already downloaded gem, while a slow native extension build occupies a slot that could download another gem.
What is your fix for the problem, implemented in this PR?
Use separate download and installation worker pools connected to a shared completion queue. Both pools retain the existing
BUNDLE_JOBSsize, and compact-index metadata concurrency remains unchanged. This lets network I/O overlap installation without changing Bundler's existing concurrency settings.Serialize on-demand remote spec lookups so concurrent default-gem downloads cannot race while refreshing shared source state.
Scope update
AddBUNDLE_DOWNLOAD_JOBSandBUNDLE_METADATA_JOBS, and makeBUNDLE_JOBSinstallation-only. Downloads default to 3× installation jobs, capped at 8; metadata defaults to download jobs.Across five alternating cold-cache Docker builds per variant, median install time improved by 8.5% (66.0s versus 72.1s) and mean install time improved by 9.2% (67.2s versus 74.0s).Those statements are outdated because the original benchmark changed both the scheduler and its concurrency settings. With concurrency matched to master, review measurements retained a 7.6% reduction from the original 9.5% reduction. My benchmark host reported
nprocas 11, and I do not have a measurement that isolates the settings. This revision therefore keeps the scheduler and race fix while removing the new settings and the narrowerBUNDLE_JOBSsemantics.Make sure the following tasks are checked