Skip to content

perf(pacquet): skip redundant bin relinking - #14038

Closed
zkochan wants to merge 1 commit into
mainfrom
perf-skip-redundant-bin-relink
Closed

zkochan wants to merge 1 commit into
mainfrom
perf-skip-redundant-bin-relink

Conversation

@zkochan

@zkochan zkochan commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Skip the isolated link phase's project-bin re-walk unless it added a publicly hoisted workspace package.
  • When --ignore-scripts bypasses dependency builds, skip the post-build direct-bin relink unless the root has public-hoist bin candidates. Preserve the full relink after real builds so lifecycle-created bins are still discovered.
  • Add focused routing tests and retain the end-to-end public-workspace-hoist coverage.

This is a pacquet-internal pipeline optimization related to pnpm/tasks#1 and #14022. The TypeScript implementation already performs its corresponding bin link once after dependency builds, so it does not need a matching change.

Paired local A/B benchmark of the tracked update scenario (8 pairs, 4 cores, 50 ms registry RTT, 200 Mbit/s):

Merge base This PR Change
Mean 747.8 ms 734.3 ms -13.5 ms (-1.8%)
Median 751.0 ms 732.5 ms -18.5 ms (-2.5%)

Head was faster in 6 of 8 pairs.

Validation:

  • just ready — 8,452 tests passed, plus workspace checks and Clippy.
  • cargo test -p pnpm-cli publicly_hoisted_workspace_package — both public-workspace-hoist bin tests passed.

Squash Commit Body

Avoid two bin-linking scans whose prerequisites are absent on the common
ignore-scripts update path. The link phase now re-walks project bins only when
it placed a publicly hoisted workspace package, and the build phase relinks
top-level bins only after a real dependency build or for root public-hoist bin
candidates.

Keep full relinking after lifecycle builds so package.json changes made by
scripts are still observed, and retain the public-workspace-hoist path that is
the sole source of those workspace bin shims.

Related to pnpm/tasks#1 and pnpm/pnpm#14022.

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

Written by an agent (Codex, GPT-5).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Performance

    • Reduced install time with --ignore-scripts by skipping unnecessary binary relinking when dependency builds and public hoisting do not require it.
  • Bug Fixes

    • Preserved binary links for direct and publicly hoisted dependencies, including cases where a direct dependency’s binary takes precedence over a conflicting transitive binary.

Copilot AI lite review requested due to automatic review settings August 20, 2026 15:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 68ba7eaf-656a-4c51-85f3-49614d2083e1

📥 Commits

Reviewing files that changed from the base of the PR and between 1401b98 and 046093e.

📒 Files selected for processing (3)
  • pnpm/crates/cli/tests/suite/hoist/patterns.rs
  • pnpm/crates/deps-restorer/src/install_frozen_lockfile/build_phase.rs
  • pnpm/crates/deps-restorer/src/install_frozen_lockfile/build_phase/tests.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The frozen lockfile build phase now checks top-level binary-link eligibility for each importer before linking. Tests cover root and non-root conditions, and an integration test checks binary links under --ignore-scripts with public hoisting.

Changes

Bin relink optimization

Layer / File(s) Summary
Per-importer bin-link eligibility
pnpm/crates/deps-restorer/src/install_frozen_lockfile/build_phase.rs, pnpm/crates/deps-restorer/src/install_frozen_lockfile/build_phase/tests.rs
The build phase checks each importer with needs_top_level_bin_link before linking. Unit tests cover root and non-root importer conditions.
Public-hoist integration coverage
pnpm/crates/cli/tests/suite/hoist/patterns.rs, .changeset/skip-redundant-bin-relinks.md
The integration test checks direct and publicly hoisted binary links under --ignore-scripts, including precedence when binary names conflict. The changeset documents a patch release.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Suggested labels: product: pacquet

Merge Risk: ⚪ Minimal · up to 04609

The bin-linking optimization appears ready to merge after normal checks; no actionable issue remains identified.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

perf(pacquet): skip redundant bin relinking

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Skip the link-phase project bin re-walk unless a public-hoisted workspace package was placed.
• Skip post-build top-level bin relinking when --ignore-scripts bypasses builds, except root
 public-hoist bins.
• Add focused unit tests and ship a pacquet patch changeset describing the perf improvement.
Diagram

graph TD
  A["Install pipeline"] --> B["Link phase"] --> C{"Public-hoisted workspace pkg?"}
  C -- "yes" --> D["Re-walk project bins"] --> F["Build phase"]
  C -- "no" --> F["Build phase"] --> G{"Need top-level bin relink?"}
  G -- "yes" --> H["Relink top-level bins"] --> J["Done"]
  G -- "no" --> J["Done"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Persist a bin-scan “dirty” marker across phases
  • ➕ More robust: decision is based on actual bin-affecting operations rather than proxies (hoist kind / build ran)
  • ➕ Could generalize to other future bin-affecting steps without more conditionals
  • ➖ Requires new plumbing/state propagation between phases and careful correctness auditing
  • ➖ Higher implementation complexity for a small perf win
2. Incremental bin relink via filesystem change detection
  • ➕ Avoids full re-walk by comparing cached metadata (mtimes/hashes) for relevant manifests/bin entries
  • ➖ Adds caching complexity and potential cross-platform filesystem edge cases
  • ➖ Risk of missing lifecycle-script-created bins unless the detection is very carefully scoped

Recommendation: Current approach is the best tradeoff: it removes two redundant scans on the common --ignore-scripts update path while explicitly preserving the full relink when lifecycle scripts may have created bins. The alternatives offer broader optimization headroom but add state/caching complexity and higher correctness risk in a sensitive install path.

Files changed (5) +62 / -4

Enhancement (2) +33 / -2
build_phase.rsGate post-build top-level bin relink on actual bin-affecting work +19/-1

Gate post-build top-level bin relink on actual bin-affecting work

• Tracks whether BuildModules actually ran and skips the post-build per-importer top-level bin relink when builds were deferred. Still runs the relink for the root importer if public-hoist bin candidates exist, and keeps the full relink after real builds to detect lifecycle-created bins.

pnpm/crates/deps-restorer/src/install_frozen_lockfile/build_phase.rs

linking.rsSkip link-phase project bin re-walk unless public-hoisted workspace bins are possible +14/-1

Skip link-phase project bin re-walk unless public-hoisted workspace bins are possible

• Detects when the hoist result includes publicly hoisted workspace packages and gates the importer 'node_modules/.bin' re-walk accordingly. Adds a small helper to identify public-hoisted workspace aliases and wires in a test module.

pnpm/crates/deps-restorer/src/linking.rs

Tests (2) +24 / -2
tests.rsAdd unit test for post-build bin relink predicate +13/-2

Add unit test for post-build bin relink predicate

• Imports the new predicate and adds coverage ensuring top-level relinking only runs when a build ran or root public-hoist bins can affect outcomes.

pnpm/crates/deps-restorer/src/install_frozen_lockfile/build_phase/tests.rs

tests.rsAdd unit test for public-hoisted workspace detection helper +11/-0

Add unit test for public-hoisted workspace detection helper

• Introduces a focused test validating that only 'HoistKind::Public' workspace aliases trigger the link-phase bin re-walk behavior.

pnpm/crates/deps-restorer/src/linking/tests.rs

Documentation (1) +5 / -0
skip-redundant-bin-relinks.mdAdd pacquet patch changeset for ignore-scripts install perf +5/-0

Add pacquet patch changeset for ignore-scripts install perf

• Adds a changeset announcing reduced install time when '--ignore-scripts' allows skipping redundant bin relinking.

.changeset/skip-redundant-bin-relinks.md

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5

The PR appears safe to merge, with the non-blocking concern that its newly skipped filesystem paths are covered only by predicate-level tests.

The earlier link phase reads and links the same unchanged direct-bin manifests when builds are deferred, and public workspace bins remain routed through the retained rewalk; stronger fixture coverage would protect those assumptions.

Files Needing Attention: pnpm/crates/deps-restorer/src/install_frozen_lockfile/build_phase/tests.rs, pnpm/crates/deps-restorer/src/linking/tests.rs

Reviews (1): Last reviewed commit: "perf(pacquet): skip redundant bin relink..." | Re-trigger Greptile

Comment on lines +64 to +71
#[test]
fn top_level_bin_link_only_runs_when_post_materialization_work_can_change_bins() {
let public_hoisted = ["public-cli".to_string()];

assert!(!needs_top_level_bin_link(Lockfile::ROOT_IMPORTER_KEY, false, &[]));
assert!(needs_top_level_bin_link(Lockfile::ROOT_IMPORTER_KEY, false, &public_hoisted));
assert!(!needs_top_level_bin_link("packages/app", false, &public_hoisted));
assert!(needs_top_level_bin_link("packages/app", true, &[]));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Predicate tests miss bin behavior

These assertions mirror the new routing predicate without exercising the filesystem behavior that permits relinking to be skipped. Add a fixture-level --ignore-scripts install test that verifies direct, public-hoist, and conflicting bins remain correct; otherwise an incorrect assumption about the earlier link phase can regress commands while these tests continue passing.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added a fixture-level integration test (bin_linking_under_ignore_scripts_preserves_direct_hoisted_and_conflicting_bins in pnpm/crates/cli/tests/suite/hoist/patterns.rs) that runs against the mock registry with --ignore-scripts. It verifies that direct bins (@pnpm.e2e/touch-file-one-bin), publicly hoisted transitive bins (@pnpm.e2e/peer-with-bin), and conflicting bins (@pnpm.e2e/hello-world-js-bin-parent vs hoisted @pnpm.e2e/hello-world-js-bin) are correctly linked and that the direct dependency wins the collision in .bin.

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@github-actions

github-actions Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.08     14.1±0.36ms    26.6 MB/sec    1.00     13.0±0.18ms    28.7 MB/sec
packument/parse                                  1.00     43.3±0.28µs  1530.3 MB/sec    1.00     43.3±0.35µs  1531.1 MB/sec
tarball/download_dependency                      1.04      4.8±0.26ms   894.4 KB/sec    1.00      4.6±0.19ms   933.5 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.08    248.3±2.25ms 64.4 KElem/sec    1.00    229.2±3.42ms 69.8 KElem/sec
workspace_resolution/hoist_heavy                 1.13    306.0±3.38ms        ? ?/sec    1.00    270.5±4.56ms        ? ?/sec
workspace_sort/chained_projects                  1.00     18.0±0.82ms        ? ?/sec    1.03     18.6±0.95ms        ? ?/sec

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Aug 20, 2026
@codecov-commenter

codecov-commenter commented Aug 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.86%. Comparing base (d44a097) to head (046093e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   pnpm/pnpm#14038   +/-   ##
=======================================
  Coverage   91.85%   91.86%           
=======================================
  Files        1453     1453           
  Lines      196080   196089    +9     
=======================================
+ Hits       180112   180128   +16     
+ Misses      15968    15961    -7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Same-run regression check

HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.

Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2336.68 ms 2447.14 ms 4.7% 116.83 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1449.40 ms 1597.25 ms 10.2% 72.47 ms Inconclusive (overlapping samples)
isolated-fresh-restore-hot-cache-hot-store pacquet 237.67 ms 220.91 ms -7.1% 11.88 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 249.76 ms 248.37 ms -0.6% 12.49 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 8.07 ms 14.21 ms 76.1% 2.00 ms Inconclusive (overlapping samples)
isolated-repeat-install-hot-cache-hot-store pnpr 8.03 ms 7.92 ms -1.4% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 10.15 ms 10.43 ms 2.7% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 12.58 ms 11.83 ms -6.0% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2645.24 ms 2683.18 ms 1.4% 132.26 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1679.65 ms 1587.41 ms -5.5% 83.98 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 436.78 ms 455.71 ms 4.3% 21.84 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 269.11 ms 280.00 ms 4.0% 13.46 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1659.68 ms 1671.31 ms 0.7% 82.98 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 331.45 ms 291.69 ms -12.0% 16.57 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 430.55 ms 421.87 ms -2.0% 21.53 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 135.98 ms 136.49 ms 0.4% 6.80 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 668.10 ms 626.83 ms -6.2% 33.40 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 282.58 ms 225.87 ms -20.1% 14.13 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4327.01 ms 4380.05 ms 1.2% 216.35 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3432.86 ms 3403.82 ms -0.8% 171.64 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 132.39 ms 129.13 ms -2.5% 6.62 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 149.87 ms 200.66 ms 33.9% 7.49 ms Inconclusive (overlapping samples)

Integrated-Benchmark Report (Linux)

Commit: 046093e80e3d

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.451 ± 0.143 2.291 2.623 1.65 ± 0.16
pacquet@main 2.369 ± 0.087 2.269 2.530 1.59 ± 0.14
pnpr@HEAD 1.526 ± 0.126 1.332 1.635 1.02 ± 0.12
pnpr@main 1.489 ± 0.121 1.331 1.684 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.4512003987999997,
      "stddev": 0.14271648511299656,
      "median": 2.4471425699,
      "user": 1.3615402,
      "system": 1.2997623999999997,
      "min": 2.2906758654,
      "max": 2.6234271594
    },
    {
      "command": "pacquet@main",
      "mean": 2.3688968388,
      "stddev": 0.08733709663026736,
      "median": 2.3366761689,
      "user": 1.4317956000000003,
      "system": 1.3616137,
      "min": 2.2694732304,
      "max": 2.5302347884
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5257680208,
      "stddev": 0.1257633890015409,
      "median": 1.5972511089,
      "user": 1.3459251,
      "system": 1.4049243,
      "min": 1.3320910304,
      "max": 1.6348612764000001
    },
    {
      "command": "pnpr@main",
      "mean": 1.4888123697000002,
      "stddev": 0.12050834987020424,
      "median": 1.4493984104,
      "user": 1.3526647,
      "system": 1.3677299,
      "min": 1.3305355864,
      "max": 1.6835181364
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 222.7 ± 7.2 214.0 236.3 1.00
pacquet@main 238.4 ± 12.7 215.0 263.5 1.07 ± 0.07
pnpr@HEAD 249.2 ± 17.6 227.3 286.5 1.12 ± 0.09
pnpr@main 250.4 ± 11.0 235.9 268.6 1.12 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.22267934254,
      "stddev": 0.007218543748142875,
      "median": 0.22091074464,
      "user": 0.24048866000000002,
      "system": 0.53194468,
      "min": 0.21402934164,
      "max": 0.23627699964
    },
    {
      "command": "pacquet@main",
      "mean": 0.23839668934000002,
      "stddev": 0.012657610739064374,
      "median": 0.23767020914,
      "user": 0.24999276000000004,
      "system": 0.6033651800000001,
      "min": 0.21501092364000002,
      "max": 0.26345500964
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.24919138074,
      "stddev": 0.017620025753788467,
      "median": 0.24836860464000002,
      "user": 0.25631196,
      "system": 0.56545198,
      "min": 0.22731933364,
      "max": 0.28647326164000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.25036592044000006,
      "stddev": 0.011000337577461106,
      "median": 0.24976471964000002,
      "user": 0.26444576,
      "system": 0.5709231800000001,
      "min": 0.23585662064000001,
      "max": 0.26862817564
    }
  ]
}

Scenario: Isolated linker: repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 13.3 ± 4.1 7.2 23.8 1.66 ± 0.53
pacquet@main 8.4 ± 1.0 6.9 12.2 1.05 ± 0.15
pnpr@HEAD 8.0 ± 0.6 6.9 12.7 1.00
pnpr@main 8.2 ± 0.7 7.1 11.6 1.02 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.013296525462972969,
      "stddev": 0.004085896778990192,
      "median": 0.014214812740000003,
      "user": 0.00739945013513514,
      "system": 0.006539481351351353,
      "min": 0.007219891240000001,
      "max": 0.02383757824
    },
    {
      "command": "pacquet@main",
      "mean": 0.008426987531793313,
      "stddev": 0.001044249550706736,
      "median": 0.00807192724,
      "user": 0.004350909604863226,
      "system": 0.00450119890577508,
      "min": 0.006851060240000001,
      "max": 0.01219624524
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.00802682772036253,
      "stddev": 0.0006317501152539727,
      "median": 0.00791887124,
      "user": 0.004749402235649545,
      "system": 0.003720695105740183,
      "min": 0.006907628240000001,
      "max": 0.01266342724
    },
    {
      "command": "pnpr@main",
      "mean": 0.008154391782016806,
      "stddev": 0.0007264589866273306,
      "median": 0.00803402024,
      "user": 0.004444406386554619,
      "system": 0.004193838151260505,
      "min": 0.007062446240000001,
      "max": 0.011563514240000001
    }
  ]
}

Scenario: Isolated linker: repeat install, cold cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 11.0 ± 2.2 7.3 20.3 1.06 ± 0.24
pacquet@main 10.4 ± 1.1 8.1 17.8 1.00
pnpr@HEAD 12.1 ± 2.1 8.6 23.2 1.17 ± 0.24
pnpr@main 12.8 ± 1.6 9.6 18.0 1.23 ± 0.21
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.010970429101094527,
      "stddev": 0.0022321428191746993,
      "median": 0.01042789832,
      "user": 0.005539836915422883,
      "system": 0.006027452537313428,
      "min": 0.007323658320000001,
      "max": 0.020320553320000004
    },
    {
      "command": "pacquet@main",
      "mean": 0.010382134704313732,
      "stddev": 0.0011129456092274725,
      "median": 0.01015009632,
      "user": 0.006051247450980392,
      "system": 0.004879231372549019,
      "min": 0.00813230432,
      "max": 0.01783811932
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.012108760512771086,
      "stddev": 0.0021069749244048926,
      "median": 0.01182979632,
      "user": 0.006940842489959838,
      "system": 0.005852263293172695,
      "min": 0.00859976932,
      "max": 0.023197246320000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.012793121047777781,
      "stddev": 0.0016376902312566406,
      "median": 0.012584934320000001,
      "user": 0.007411431111111111,
      "system": 0.006039093111111113,
      "min": 0.00959674932,
      "max": 0.018048752320000003
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.694 ± 0.048 2.622 2.783 1.68 ± 0.13
pacquet@main 2.642 ± 0.027 2.598 2.675 1.64 ± 0.13
pnpr@HEAD 1.608 ± 0.126 1.450 1.815 1.00
pnpr@main 1.634 ± 0.132 1.454 1.794 1.02 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.69369911398,
      "stddev": 0.04825521252933615,
      "median": 2.6831836250800003,
      "user": 2.4262711,
      "system": 2.1667297999999997,
      "min": 2.62214204708,
      "max": 2.78342103308
    },
    {
      "command": "pacquet@main",
      "mean": 2.64218899018,
      "stddev": 0.026916727579696088,
      "median": 2.6452375315800003,
      "user": 2.2738621,
      "system": 2.0034154,
      "min": 2.59813788208,
      "max": 2.6753403600800003
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.60753966898,
      "stddev": 0.1256962956714165,
      "median": 1.58740968858,
      "user": 1.3535205,
      "system": 1.6237824999999997,
      "min": 1.4501650420799999,
      "max": 1.81515328408
    },
    {
      "command": "pnpr@main",
      "mean": 1.6338516026799996,
      "stddev": 0.13249220090093933,
      "median": 1.6796526885799998,
      "user": 1.3533611000000003,
      "system": 1.5859937999999996,
      "min": 1.45413679008,
      "max": 1.7935846550799999
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 451.3 ± 35.5 401.5 521.4 1.63 ± 0.18
pacquet@main 427.6 ± 22.4 388.6 456.2 1.54 ± 0.15
pnpr@HEAD 279.1 ± 10.6 260.2 294.3 1.01 ± 0.09
pnpr@main 277.1 ± 22.7 254.8 336.0 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.4512676420600001,
      "stddev": 0.03549555474783466,
      "median": 0.4557059909600001,
      "user": 0.6513647199999999,
      "system": 0.7398496399999999,
      "min": 0.40146953246000006,
      "max": 0.5213953654600001
    },
    {
      "command": "pacquet@main",
      "mean": 0.42763650406,
      "stddev": 0.022446744803021914,
      "median": 0.43678298246,
      "user": 0.60099672,
      "system": 0.73458134,
      "min": 0.38860594246,
      "max": 0.45615674346000007
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.27914588766000004,
      "stddev": 0.010625490349400772,
      "median": 0.27999682096,
      "user": 0.22165052,
      "system": 0.50238204,
      "min": 0.26019032546000004,
      "max": 0.29433925946000006
    },
    {
      "command": "pnpr@main",
      "mean": 0.27711721666000005,
      "stddev": 0.022665077296735708,
      "median": 0.26911322646,
      "user": 0.23890141999999998,
      "system": 0.49173283999999995,
      "min": 0.25484778546000003,
      "max": 0.33596164346
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.676 ± 0.037 1.637 1.754 5.67 ± 0.37
pacquet@main 1.686 ± 0.062 1.640 1.844 5.70 ± 0.41
pnpr@HEAD 0.296 ± 0.018 0.277 0.333 1.00
pnpr@main 0.325 ± 0.024 0.281 0.362 1.10 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.6757944385799999,
      "stddev": 0.03678898266519345,
      "median": 1.67130895418,
      "user": 0.9820605599999996,
      "system": 0.8576046999999999,
      "min": 1.63656308268,
      "max": 1.75372328268
    },
    {
      "command": "pacquet@main",
      "mean": 1.6855340852799998,
      "stddev": 0.06213768470911912,
      "median": 1.6596760986799999,
      "user": 1.01774126,
      "system": 0.8636039999999999,
      "min": 1.6401695936799998,
      "max": 1.84446963968
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29575672818000004,
      "stddev": 0.018095745099223334,
      "median": 0.29168842568000003,
      "user": 0.23451255999999998,
      "system": 0.5650174000000001,
      "min": 0.27739423168000005,
      "max": 0.33312248868000005
    },
    {
      "command": "pnpr@main",
      "mean": 0.32466833438,
      "stddev": 0.023980603258985968,
      "median": 0.33145385718000003,
      "user": 0.27583406,
      "system": 0.6154578000000002,
      "min": 0.28116276568000004,
      "max": 0.36207371368
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 447.7 ± 128.3 332.4 798.6 3.28 ± 0.94
pacquet@main 419.3 ± 40.9 304.0 445.6 3.07 ± 0.31
pnpr@HEAD 136.7 ± 3.1 133.2 145.0 1.00 ± 0.03
pnpr@main 136.5 ± 3.2 132.7 145.1 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.44767220442,
      "stddev": 0.12827354520335713,
      "median": 0.42186750142000007,
      "user": 0.43505586,
      "system": 0.18315205999999998,
      "min": 0.33243775642000006,
      "max": 0.7986142074200001
    },
    {
      "command": "pacquet@main",
      "mean": 0.41929357262,
      "stddev": 0.04094661459070203,
      "median": 0.43054552692000003,
      "user": 0.42052176,
      "system": 0.15814136,
      "min": 0.30396274042000004,
      "max": 0.44564918242000007
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.13671091102,
      "stddev": 0.0031300612216278423,
      "median": 0.13648727492,
      "user": 0.06139440999999999,
      "system": 0.03592086,
      "min": 0.13321008242,
      "max": 0.14497483142
    },
    {
      "command": "pnpr@main",
      "mean": 0.13648872487000002,
      "stddev": 0.003243225186653871,
      "median": 0.13597867942,
      "user": 0.06273395999999999,
      "system": 0.03505630999999999,
      "min": 0.13269887042,
      "max": 0.14511410342
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 613.6 ± 100.3 396.9 757.9 1.00
pacquet@main 631.6 ± 74.7 498.1 719.8 1.03 ± 0.21
pnpm@HEAD 3202.5 ± 228.8 2850.8 3602.9 5.22 ± 0.93
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6135614196711111,
      "stddev": 0.1003187622430676,
      "median": 0.62683003756,
      "user": 0.6371094155555554,
      "system": 0.1360177288888889,
      "min": 0.39686751456,
      "max": 0.75786276956
    },
    {
      "command": "pacquet@main",
      "mean": 0.6315586748933333,
      "stddev": 0.07469655562779715,
      "median": 0.6680964995600001,
      "user": 0.651440748888889,
      "system": 0.12718284000000002,
      "min": 0.49810086556,
      "max": 0.71976630356
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.2024771731155557,
      "stddev": 0.22875374399062012,
      "median": 3.1367821685600004,
      "user": 5.035443082222222,
      "system": 0.22976995111111112,
      "min": 2.8507592495600003,
      "max": 3.6029286595600003
    }
  ]
}

Scenario: Isolated linker: linked-workspace resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 226.5 ± 6.3 214.1 236.5 1.00
pacquet@main 288.4 ± 21.8 267.2 346.6 1.27 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.22650425857846154,
      "stddev": 0.0062819859257414856,
      "median": 0.22587362104,
      "user": 0.18001233230769226,
      "system": 0.09476583692307693,
      "min": 0.21409016204,
      "max": 0.23654267604
    },
    {
      "command": "pacquet@main",
      "mean": 0.28836926364000004,
      "stddev": 0.02177225849164752,
      "median": 0.28258316704,
      "user": 0.24210984,
      "system": 0.11454006000000001,
      "min": 0.26722532304,
      "max": 0.34662045304000005
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.464 ± 0.186 4.307 4.782 1.29 ± 0.07
pacquet@main 4.390 ± 0.131 4.306 4.720 1.26 ± 0.06
pnpr@HEAD 3.473 ± 0.127 3.371 3.727 1.00 ± 0.05
pnpr@main 3.471 ± 0.126 3.355 3.756 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.46432688468,
      "stddev": 0.18571672949559406,
      "median": 4.38004884998,
      "user": 1.5260736600000002,
      "system": 1.4747566600000002,
      "min": 4.30723379498,
      "max": 4.78227876198
    },
    {
      "command": "pacquet@main",
      "mean": 4.39039978958,
      "stddev": 0.13124725701933615,
      "median": 4.327008294980001,
      "user": 1.53902666,
      "system": 1.4387689599999998,
      "min": 4.3061631589800005,
      "max": 4.7195881789800005
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.47272332258,
      "stddev": 0.12748770507978802,
      "median": 3.40382344698,
      "user": 1.38891366,
      "system": 1.32439976,
      "min": 3.37075046798,
      "max": 3.72702833098
    },
    {
      "command": "pnpr@main",
      "mean": 3.47083849598,
      "stddev": 0.12565000575524699,
      "median": 3.4328582364800004,
      "user": 1.41357156,
      "system": 1.2740257599999998,
      "min": 3.35531983798,
      "max": 3.75610205598
    }
  ]
}

Scenario: GVS linker: fresh restore, hot cache + hot store

Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 137.5 ± 18.3 121.6 177.5 1.03 ± 0.18
pacquet@main 133.3 ± 15.1 110.2 179.1 1.00
pnpr@HEAD 196.0 ± 32.5 127.8 266.9 1.47 ± 0.29
pnpr@main 161.3 ± 23.3 134.1 197.2 1.21 ± 0.22
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.1374989529,
      "stddev": 0.018257882894747987,
      "median": 0.1291308944,
      "user": 0.15979221428571427,
      "system": 0.1524397657142857,
      "min": 0.1216136939,
      "max": 0.1774686249
    },
    {
      "command": "pacquet@main",
      "mean": 0.13325394279473685,
      "stddev": 0.015055857238825479,
      "median": 0.13238595790000002,
      "user": 0.16883768421052633,
      "system": 0.13553924315789473,
      "min": 0.1101791969,
      "max": 0.1791222979
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.19595332945555557,
      "stddev": 0.032469795059458635,
      "median": 0.2006646869,
      "user": 0.23646899999999993,
      "system": 0.1689723133333333,
      "min": 0.1277662589,
      "max": 0.2669132779
    },
    {
      "command": "pnpr@main",
      "mean": 0.1612559072846154,
      "stddev": 0.02329614131577311,
      "median": 0.1498721309,
      "user": 0.19039969230769227,
      "system": 0.15498421076923077,
      "min": 0.1341334969,
      "max": 0.1971936689
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/14038
Testbedpacquet

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
isolated-linker.peer-heavy-resolve.hot-cache.offlineLatency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
773.49 ms
(+55.32%)Baseline: 497.99 ms
597.59 ms
(129.44%)

Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
gvs-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
181.34 ms
(+2.09%)Baseline: 177.64 ms
213.16 ms
(85.07%)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,854.33 ms
(+2.25%)Baseline: 2,791.62 ms
3,349.95 ms
(85.21%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,856.54 ms
(-3.70%)Baseline: 1,927.85 ms
2,313.42 ms
(80.25%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
407.69 ms
(-11.02%)Baseline: 458.17 ms
549.80 ms
(74.15%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
188.03 ms
(-12.84%)Baseline: 215.71 ms
258.86 ms
(72.64%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,278.34 ms
(-1.19%)Baseline: 2,305.89 ms
2,767.07 ms
(82.34%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,614.04 ms
(+6.13%)Baseline: 4,347.39 ms
5,216.86 ms
(88.44%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
273.67 ms
(-1.90%)Baseline: 278.97 ms
334.76 ms
(81.75%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
🚨 view alert (🔔)
773.49 ms
(+55.32%)Baseline: 497.99 ms
597.59 ms
(129.44%)

isolated-linker.repeat-install.cold-cache.hot-store📈 view plot
🚷 view threshold
6.28 ms
(-4.31%)Baseline: 6.57 ms
7.88 ms
(79.74%)
isolated-linker.repeat-install.hot-cache.hot-store📈 view plot
🚷 view threshold
5.83 ms
(-8.31%)Baseline: 6.36 ms
7.63 ms
(76.41%)
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan force-pushed the perf-skip-redundant-bin-relink branch from 1401b98 to 046093e Compare September 25, 2026 07:35
@qodo-code-review

qodo-code-review Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

No code changes since the last review — review skipped

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan

zkochan commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Superseded by #14300, which already skips the post-build top-level bin relink unless the install is hoisted, a slot was mutated, or the root has publicly hoisted candidates. Closing.

@zkochan zkochan closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review state: automerge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants