perf(pm): prioritize install clone pumping#2992
Draft
elrrrrrrr wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request reorders the execution of pump_clones and pump_extracts within the SchedulerState::run loop in crates/pm/src/service/install_scheduler.rs. This change prioritizes network prefetch and materialization work before starting cache writes. There are no review comments to address, and I have no further feedback to provide.
📊 pm-bench-phases ·
|
| PM | wall | ±σ | user | sys | RSS | pgMinor |
|---|---|---|---|---|---|---|
| bun | 9.53s | 0.18s | 10.31s | 10.53s | 590M | 291.1K |
| utoo-next | 8.94s | 1.14s | 10.49s | 12.81s | 988M | 119.8K |
| utoo-npm | 9.40s | 1.87s | 10.83s | 12.98s | 1002M | 124.3K |
| utoo | 7.73s | 0.08s | 11.22s | 11.59s | 934M | 147.9K |
| PM | vCtx | iCtx | netRX | netTX | cache | node_mod | lock |
|---|---|---|---|---|---|---|---|
| bun | 19.6K | 17.9K | 1.19G | 7M | 1.84G | 1.73G | 1M |
| utoo-next | 137.5K | 98.5K | 1.16G | 5M | 1.71G | 1.70G | 2M |
| utoo-npm | 147.6K | 106.4K | 1.16G | 6M | 1.71G | 1.70G | 2M |
| utoo | 77.0K | 50.9K | 1.16G | 6M | 1.71G | 1.70G | 2M |
p1_resolve
| PM | wall | ±σ | user | sys | RSS | pgMinor |
|---|---|---|---|---|---|---|
| bun | 2.58s | 0.01s | 3.89s | 1.17s | 498M | 188.8K |
| utoo-next | 3.30s | 0.08s | 5.48s | 2.27s | 613M | 82.0K |
| utoo-npm | 3.37s | 0.03s | 5.63s | 2.27s | 624M | 80.4K |
| utoo | 2.49s | 0.04s | 6.03s | 1.79s | 648M | 123.7K |
| PM | vCtx | iCtx | netRX | netTX | cache | node_mod | lock |
|---|---|---|---|---|---|---|---|
| bun | 13.9K | 3.3K | 202M | 3M | 107M | - | 1M |
| utoo-next | 82.0K | 88.7K | 200M | 3M | 7M | 3M | 2M |
| utoo-npm | 83.0K | 90.7K | 200M | 3M | 7M | 3M | 2M |
| utoo | 17.5K | 20.3K | 202M | 3M | 7M | 3M | 2M |
p3_cold_install
| PM | wall | ±σ | user | sys | RSS | pgMinor |
|---|---|---|---|---|---|---|
| bun | 6.80s | 0.21s | 6.33s | 10.49s | 570M | 199.3K |
| utoo-next | 8.22s | 1.11s | 5.08s | 11.35s | 442M | 59.9K |
| utoo-npm | 7.36s | 1.71s | 5.23s | 11.25s | 489M | 62.1K |
| utoo | 5.57s | 0.12s | 4.84s | 9.64s | 485M | 62.0K |
| PM | vCtx | iCtx | netRX | netTX | cache | node_mod | lock |
|---|---|---|---|---|---|---|---|
| bun | 7.2K | 8.7K | 1019M | 5M | 1.76G | 1.76G | 1M |
| utoo-next | 123.0K | 52.9K | 990M | 3M | 1.70G | 1.70G | 3M |
| utoo-npm | 115.2K | 55.0K | 990M | 3M | 1.70G | 1.70G | 3M |
| utoo | 52.1K | 34.7K | 989M | 2M | 1.70G | 1.70G | 3M |
p4_warm_link
| PM | wall | ±σ | user | sys | RSS | pgMinor |
|---|---|---|---|---|---|---|
| bun | 3.23s | 0.14s | 0.20s | 2.32s | 134M | 32.5K |
| utoo-next | 2.48s | 0.45s | 0.49s | 3.85s | 79M | 18.4K |
| utoo-npm | 2.38s | 0.12s | 0.50s | 3.78s | 79M | 18.7K |
| utoo | 2.10s | 0.13s | 0.34s | 3.35s | 50M | 11.3K |
| PM | vCtx | iCtx | netRX | netTX | cache | node_mod | lock |
|---|---|---|---|---|---|---|---|
| bun | 390 | 22 | 5M | 57K | 1.91G | 1.75G | 1M |
| utoo-next | 40.9K | 17.6K | 1K | 4K | 1.70G | 1.70G | 2M |
| utoo-npm | 42.1K | 19.2K | 2K | 5K | 1.70G | 1.70G | 2M |
| utoo | 7.6K | 4.4K | 3K | 9K | 1.71G | 1.70G | 2M |
npmmirror.com: no output captured.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is an independent p3 scheduler experiment on top of #2989.
The install scheduler currently pumps ready work in this order:
When p3 has both extracted packages and ready clone placements, new extract workers can enter the global rayon queue before materialize workers. This PR keeps network prefetch first, but gives ready clone/materialize work a chance to enter rayon before starting more cache writes.
Hypothesis
Validation
cargo fmtcargo test -p utoo-pm install_schedulercargo clippy -p utoo-pm --all-targets -- -D warnings --no-depsBench Result
GHA Linux npmjs run
26093648834:p4 is a no-op control for this PR because there is no extract queue in warm link, so its movement is GHA noise. p3 regressed versus #2989 latest npmjs reference (
5.29s, 53.0K/32.9K).Conclusion: reject for now. Pure pump-order priority does not look like the right p3 fix.