Skip to content

fix: ignore unobservable file modes in the Windows side-effects diff - #15859

Merged
zkochan merged 2 commits into
pnpm:mainfrom
Shuuren:cursor/windows-side-effects-exec-bit-3928
Sep 26, 2026
Merged

zkochan merged 2 commits into
pnpm:mainfrom
Shuuren:cursor/windows-side-effects-exec-bit-3928

Conversation

@Shuuren

@Shuuren Shuuren commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #15667.

On Windows, a side-effects row is never empty when a tarball entry's mode differs from what the post-build rehash reads. The diff records a file as added when its digest or its mode changed, and Windows has no execute bit, so the rehash cannot observe the tarball's mode:

  • pnpm 12 reports a fixed 0o644, so any 0o755 file in the tarball lands in added with an unchanged digest.
  • pnpm 11 reports stat.mode & 0o777, which is 0o666 on Windows (or 0o444 for a read-only file), so every file lands in added.

Both stacks rebuild only when the row has nothing to restore (#14744 for pnpm 12). With those added entries, a build whose whole effect lies outside the package directory, such as a git hook installer, counts as a cache hit and never runs again.

Modes are compared only where the rehash can observe them: cfg!(unix) in pacquet, matching file_mode_from, and process.platform !== 'win32' in the v11 worker. A file whose content changed is still recorded.

No open pull request already fixed this. #15672 took the same approach and was closed without merging.

The new fixture version @pnpm.e2e/[email protected] ships bin/tool.js. The fixture packer stores that file as mode 0o755 on every OS. Linux runs prove the install path. The mode-only diff is compiled out here, so the Windows CI jobs are what fail if the ignore regresses.

AI-assisted change.

Squash Commit Body

On Windows the post-build rehash cannot see the mode stored from the
tarball. pnpm 12 reports a fixed 0o644 and pnpm 11 reports the mode
from fs.stat (0o666, or 0o444 for a read-only file). The side-effects
diff treated that difference as an added file, so the row was never
empty.

Both stacks rebuild only when the row has nothing to restore
(pnpm/pnpm#14744 for pnpm 12). A build whose whole effect lies outside
the package directory, such as a git hook installer, was treated as a
cache hit and skipped. Compare modes only where the rehash can observe
them.

Closes pnpm/pnpm#15667

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • New features are implemented only in the Rust pnpm v12 CLI. Bug fixes
    are implemented in every affected version.
  • 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 (Cursor, Grok 4.7).

Summary by CodeRabbit

  • Bug Fixes
    • Fixed Windows side-effects caching so subsequent installs rerun build scripts when their changes cannot be restored from the package cache. This helps preserve effects such as updates to files outside the package directory.
    • Windows installs now ignore file permission changes when comparing cached build output, while still detecting file additions, removals, and content changes.

cursoragent and others added 2 commits September 26, 2026 02:46
On Windows the post-build rehash cannot see the mode stored from the
tarball. pnpm 12 reports a fixed 0o644 and pnpm 11 reports the mode
from fs.stat (0o666, or 0o444 for a read-only file). The side-effects
diff treated that difference as an added file, so the row was never
empty.

Both stacks rebuild only when the row has nothing to restore. A build
whose whole effect lies outside the package directory, such as a git
hook installer, was treated as a cache hit and skipped. Compare modes
only where the rehash can observe them.

Closes pnpm#15667

Co-authored-by: Gabriel Mari S. Flores <[email protected]>
The fixed mode reported off Unix is not a reading of the tarball entry,
so a mode-only difference is not build output.

Closes pnpm#15667

Co-authored-by: Gabriel Mari S. Flores <[email protected]>
@Shuuren
Shuuren requested a review from zkochan as a code owner September 26, 2026 03:45
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Sep 26, 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: 500dd804-b5ec-440f-9ac0-1c3f98082c44

📥 Commits

Reviewing files that changed from the base of the PR and between 7c1b501 and 9fc5206.

📒 Files selected for processing (10)
  • .changeset/windows-side-effects-cache-exec-bit.md
  • .changeset/windows-side-effects-cache-mode.md
  • pnpm/crates/cli/tests/suite/side_effects_cache.rs
  • pnpm/crates/store-dir/src/add_files_from_dir.rs
  • pnpm/crates/store-dir/src/upload.rs
  • pnpm/crates/store-dir/src/upload/tests.rs
  • pnpm11/installing/deps-installer/test/install/sideEffects.ts
  • pnpm11/worker/src/start.ts
  • pnpr/.fixtures/packages/@pnpm.e2e/postinstall-writes-outside-package/1.1.0/bin/tool.js
  • pnpr/.fixtures/packages/@pnpm.e2e/postinstall-writes-outside-package/1.1.0/package.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The changes ignore file-mode differences when calculating side-effects cache diffs on non-Unix hosts. Regression tests cover repeated package builds and confirm that digest changes still appear in the diff.

Changes

Windows side-effects cache

Layer / File(s) Summary
Rust side-effects diff behavior
pnpm/crates/store-dir/src/add_files_from_dir.rs, pnpm/crates/store-dir/src/upload.rs, pnpm/crates/store-dir/src/upload/tests.rs, pnpm/crates/cli/tests/suite/side_effects_cache.rs, .changeset/windows-side-effects-cache-exec-bit.md
The Rust diff comparison ignores mode-only differences off Unix and retains digest changes. Tests cover both cases and verify that builds run on repeated installs.
pnpm 11 behavior and regression test
pnpm11/worker/src/start.ts, pnpr/.fixtures/packages/@pnpm.e2e/postinstall-writes-outside-package/1.1.0/*, pnpm11/installing/deps-installer/test/install/sideEffects.ts, .changeset/windows-side-effects-cache-mode.md
The pnpm 11 worker ignores mode differences on Windows. The install test verifies that the package build runs again after reinstalling from the same store.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Assessment against linked issues

Objective Addressed Explanation
[#15667] On Windows, a file whose content is unchanged and whose mode differs only because Windows has no execute bit must not make the side-effects row non-empty. ✅

Suggested labels: product: pnpm@11, product: pacquet, product: pnpr

Merge Risk: ⚪ Minimal · up to 9fc52

The change addresses the Windows cache-hit case without an identified regression. It is ready to merge after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 9fc52

The change can cause already-permitted install scripts to run again when a cache entry has nothing to restore. The reviewed paths retain build permission checks and content-change detection; no new permission boundary or confirmed security issue was found. Windows runtime validation remains a limitation.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The relevant exposure is repeated execution of an already-authorized package script on installs whose cached diff has no in-package effect. The fixture demonstrates an effect outside the package directory; the reviewed change does not grant that script authority.

Trust Boundaries and Controls

  • observed — The Rust build policy retains package-identity checks, while cache reuse requires an exact keyed overlay. Neither control is replaced by the new mode comparison.

Resilience and Maintainability Implications

  • observed — The Rust writer skips side-effects upload on a hash-algorithm mismatch, and the overlay reader discards an empty diff rather than treating it as a successful cached build.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

pnpm11/installing/deps-installer/test/install/sideEffects.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

pnpm11/worker/src/start.ts

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

pnpr/.fixtures/packages/@pnpm.e2e/postinstall-writes-outside-package/1.1.0/bin/tool.js

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

  • 1 others

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.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.01%. Comparing base (7c1b501) to head (9fc5206).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15859      +/-   ##
==========================================
- Coverage   92.01%   92.01%   -0.01%     
==========================================
  Files        1478     1478              
  Lines      198923   198925       +2     
==========================================
+ Hits       183042   183043       +1     
- Misses      15881    15882       +1     

☔ 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 added the reviewed: coderabbit CodeRabbit submitted an approving review label Sep 26, 2026
@github-actions

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 2364.03 ms 2480.27 ms 4.9% 118.20 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1622.31 ms 1530.56 ms -5.7% 81.12 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 228.72 ms 235.19 ms 2.8% 11.44 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 249.39 ms 254.58 ms 2.1% 12.47 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 7.79 ms 7.84 ms 0.7% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 10.88 ms 8.07 ms -25.8% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 7.03 ms 7.33 ms 4.3% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 7.53 ms 7.80 ms 3.6% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2503.62 ms 2524.89 ms 0.8% 125.18 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1501.50 ms 1504.29 ms 0.2% 75.07 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 437.12 ms 436.97 ms -0.0% 21.86 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 282.53 ms 284.41 ms 0.7% 14.13 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1624.74 ms 1645.34 ms 1.3% 81.24 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 270.70 ms 397.71 ms 46.9% 13.54 ms Inconclusive (not reproduced)
isolated-fresh-resolve-hot-cache-offline pacquet 206.79 ms 202.71 ms -2.0% 10.34 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 87.91 ms 92.40 ms 5.1% 4.40 ms Inconclusive (overlapping samples)
isolated-peer-heavy-resolve-hot-cache-offline pacquet 630.35 ms 625.62 ms -0.8% 31.52 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 301.41 ms 307.44 ms 2.0% 15.07 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4351.84 ms 4395.73 ms 1.0% 217.59 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3394.21 ms 3390.13 ms -0.1% 169.71 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 116.57 ms 117.64 ms 0.9% 5.83 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 143.44 ms 133.07 ms -7.2% 7.17 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: 9fc520640396

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.515 ± 0.139 2.373 2.796 1.63 ± 0.17
pacquet@main 2.370 ± 0.045 2.333 2.486 1.54 ± 0.14
pnpr@HEAD 1.541 ± 0.140 1.350 1.745 1.00
pnpr@main 1.589 ± 0.133 1.356 1.725 1.03 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.51527020426,
      "stddev": 0.1387449116632748,
      "median": 2.4802734919600002,
      "user": 1.6924363399999998,
      "system": 1.9491505999999998,
      "min": 2.37325424846,
      "max": 2.79590365746
    },
    {
      "command": "pacquet@main",
      "mean": 2.37027740346,
      "stddev": 0.044739547820478974,
      "median": 2.3640343384599998,
      "user": 1.58966094,
      "system": 1.9099416999999999,
      "min": 2.33319084046,
      "max": 2.4859130664599998
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.54143615256,
      "stddev": 0.13968579960021815,
      "median": 1.5305640439600001,
      "user": 1.51054314,
      "system": 1.6522588999999996,
      "min": 1.34951476946,
      "max": 1.7451071444600001
    },
    {
      "command": "pnpr@main",
      "mean": 1.58858986446,
      "stddev": 0.13266927788634308,
      "median": 1.62231220296,
      "user": 1.49115684,
      "system": 1.7457620999999999,
      "min": 1.35594383946,
      "max": 1.72473703646
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 236.2 ± 10.7 219.4 260.1 1.00
pacquet@main 251.3 ± 56.0 215.0 375.7 1.06 ± 0.24
pnpr@HEAD 299.3 ± 79.6 243.3 433.4 1.27 ± 0.34
pnpr@main 251.3 ± 6.3 243.0 264.3 1.06 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.23621833946,
      "stddev": 0.010690605435046715,
      "median": 0.23519173716000003,
      "user": 0.26283612,
      "system": 0.5748625199999999,
      "min": 0.21941417166000002,
      "max": 0.26005141566
    },
    {
      "command": "pacquet@main",
      "mean": 0.25128355716,
      "stddev": 0.05598341037558184,
      "median": 0.22872013516000003,
      "user": 0.29014612,
      "system": 0.59412382,
      "min": 0.21497212066000002,
      "max": 0.37572537966
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29925098396,
      "stddev": 0.07961780754583488,
      "median": 0.25457784266,
      "user": 0.31694062,
      "system": 0.6876623199999999,
      "min": 0.24331611866000002,
      "max": 0.43339192166
    },
    {
      "command": "pnpr@main",
      "mean": 0.25130639775999997,
      "stddev": 0.006274086460831898,
      "median": 0.24938731516,
      "user": 0.2724720199999999,
      "system": 0.5828939200000001,
      "min": 0.24304232766000003,
      "max": 0.26431533766
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 8.2 ± 1.0 6.9 12.8 1.03 ± 0.15
pacquet@main 7.9 ± 0.7 6.8 11.1 1.00
pnpr@HEAD 8.3 ± 1.1 6.5 14.6 1.04 ± 0.16
pnpr@main 11.1 ± 2.1 6.6 18.3 1.40 ± 0.29
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.008167364932558142,
      "stddev": 0.0009887612445313324,
      "median": 0.0078423431,
      "user": 0.004652996465116279,
      "system": 0.00396284558139535,
      "min": 0.006891834100000001,
      "max": 0.0128437641
    },
    {
      "command": "pacquet@main",
      "mean": 0.007936305482636657,
      "stddev": 0.000671166298587768,
      "median": 0.007787661099999999,
      "user": 0.0047365667524115794,
      "system": 0.0036557432797427606,
      "min": 0.0068163531,
      "max": 0.0111041291
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.008253690010596023,
      "stddev": 0.0010895457187221267,
      "median": 0.008069913599999999,
      "user": 0.004375434834437089,
      "system": 0.004346331920529803,
      "min": 0.006537721100000001,
      "max": 0.014605162100000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.01107943831387283,
      "stddev": 0.002115909890231435,
      "median": 0.0108809606,
      "user": 0.006395659999999997,
      "system": 0.005277287514450866,
      "min": 0.0065898581,
      "max": 0.018343760100000002
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 7.5 ± 0.8 6.4 10.9 1.06 ± 0.14
pacquet@main 7.1 ± 0.6 6.4 11.5 1.00
pnpr@HEAD 7.8 ± 0.8 6.5 11.1 1.10 ± 0.14
pnpr@main 7.6 ± 0.7 6.5 10.6 1.07 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.0075357143857761695,
      "stddev": 0.000766938792248526,
      "median": 0.0073330771800000005,
      "user": 0.004224843249097473,
      "system": 0.0037097867870036125,
      "min": 0.00638376718,
      "max": 0.01091339118
    },
    {
      "command": "pacquet@main",
      "mean": 0.007125256670740744,
      "stddev": 0.0006077580981595785,
      "median": 0.007032528180000001,
      "user": 0.004081823950617284,
      "system": 0.003385157592592591,
      "min": 0.0064115681800000004,
      "max": 0.01147088718
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.00784101450673267,
      "stddev": 0.0007692928235992112,
      "median": 0.007796064180000001,
      "user": 0.004686394785478549,
      "system": 0.003579608580858086,
      "min": 0.006542024180000001,
      "max": 0.011093109180000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.0076280838947239225,
      "stddev": 0.0006576993849083856,
      "median": 0.00752507218,
      "user": 0.004709892760736197,
      "system": 0.003310755398773006,
      "min": 0.00648660918,
      "max": 0.01061317818
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.580 ± 0.109 2.477 2.773 1.72 ± 0.12
pacquet@main 2.524 ± 0.070 2.464 2.695 1.69 ± 0.11
pnpr@HEAD 1.512 ± 0.109 1.386 1.696 1.01 ± 0.09
pnpr@main 1.498 ± 0.084 1.381 1.646 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5798492572000002,
      "stddev": 0.10886095249378028,
      "median": 2.5248949065,
      "user": 2.04733026,
      "system": 1.6430480399999996,
      "min": 2.4765637445,
      "max": 2.7732488325
    },
    {
      "command": "pacquet@main",
      "mean": 2.5239059621999997,
      "stddev": 0.07002886418584653,
      "median": 2.5036192715,
      "user": 1.8334035599999996,
      "system": 1.5348341399999998,
      "min": 2.4635214445,
      "max": 2.6954785435
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5121247395,
      "stddev": 0.10949286504065796,
      "median": 1.504290165,
      "user": 1.1109912599999998,
      "system": 1.1620707399999997,
      "min": 1.3861814344999999,
      "max": 1.6957342675
    },
    {
      "command": "pnpr@main",
      "mean": 1.4975696039,
      "stddev": 0.08370646052922096,
      "median": 1.501498392,
      "user": 1.0531168599999998,
      "system": 1.2553213399999996,
      "min": 1.3805143805,
      "max": 1.6456472544999998
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 434.7 ± 11.2 413.3 451.1 1.55 ± 0.08
pacquet@main 433.6 ± 15.8 404.7 452.3 1.55 ± 0.09
pnpr@HEAD 279.6 ± 13.2 258.8 292.5 1.00
pnpr@main 281.8 ± 9.1 267.8 293.1 1.01 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.4346985451800001,
      "stddev": 0.011219126511589498,
      "median": 0.43697141328,
      "user": 0.6233172,
      "system": 0.74701798,
      "min": 0.41326626028,
      "max": 0.45107666128000007
    },
    {
      "command": "pacquet@main",
      "mean": 0.43358449288,
      "stddev": 0.01576549289790815,
      "median": 0.43712311828000006,
      "user": 0.6356033999999999,
      "system": 0.7291781799999998,
      "min": 0.40468349628000005,
      "max": 0.45226522228000005
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.27957167948,
      "stddev": 0.013223085240464122,
      "median": 0.28441303378000005,
      "user": 0.2441351,
      "system": 0.53596898,
      "min": 0.25883824428,
      "max": 0.29247736228000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.28178821418,
      "stddev": 0.009105952385070976,
      "median": 0.28253434628000007,
      "user": 0.24016659999999995,
      "system": 0.5414014799999999,
      "min": 0.26775216328,
      "max": 0.29306116828000006
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.654 ± 0.020 1.632 1.695 6.10 ± 0.18
pacquet@main 1.646 ± 0.040 1.606 1.708 6.07 ± 0.22
pnpr@HEAD 0.403 ± 0.039 0.361 0.496 1.49 ± 0.15
pnpr@main 0.271 ± 0.007 0.259 0.285 1.00

Confirmation (reversed target order)

Command Mean [ms] Min [ms] Max [ms] Relative
pnpr@main 270.0 ± 9.3 259.0 291.6 1.00 ± 0.05
pnpr@HEAD 270.0 ± 8.2 260.5 288.5 1.00
pacquet@main 1628.6 ± 29.8 1592.1 1687.4 6.03 ± 0.21
pacquet@HEAD 1612.4 ± 17.4 1584.7 1636.0 5.97 ± 0.19
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.6537969568400002,
      "stddev": 0.020146552733056402,
      "median": 1.64534207144,
      "user": 0.9806723399999999,
      "system": 0.92804182,
      "min": 1.6321069379400002,
      "max": 1.69477738294
    },
    {
      "command": "pacquet@main",
      "mean": 1.64618356634,
      "stddev": 0.04040169616600415,
      "median": 1.62473619994,
      "user": 0.9401064399999999,
      "system": 0.90957232,
      "min": 1.60564045294,
      "max": 1.70778736894
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.40276892174000006,
      "stddev": 0.039315844360990886,
      "median": 0.39771496044,
      "user": 0.37489944,
      "system": 0.8447761199999999,
      "min": 0.36106750994,
      "max": 0.49615127494
    },
    {
      "command": "pnpr@main",
      "mean": 0.27119089143999997,
      "stddev": 0.007444512367074911,
      "median": 0.27070354094000004,
      "user": 0.22849234,
      "system": 0.48776951999999996,
      "min": 0.25921815094,
      "max": 0.28541525294
    }
  ],
  "confirmation": {
    "results": [
      {
        "command": "pnpr@main",
        "mean": 0.2700097463400001,
        "stddev": 0.009283425392740989,
        "median": 0.2673605305400001,
        "user": 0.2021465,
        "system": 0.51184414,
        "min": 0.25899066054000003,
        "max": 0.29156302454000005
      },
      {
        "command": "pnpr@HEAD",
        "mean": 0.27000439574000007,
        "stddev": 0.00816722766130502,
        "median": 0.26848658204000003,
        "user": 0.2038954,
        "system": 0.5039672399999999,
        "min": 0.26050875254000005,
        "max": 0.28846680454
      },
      {
        "command": "pacquet@main",
        "mean": 1.62860715704,
        "stddev": 0.029751403638938644,
        "median": 1.6200538725400002,
        "user": 0.9118551,
        "system": 0.8259236399999998,
        "min": 1.59213030154,
        "max": 1.68740206154
      },
      {
        "command": "pacquet@HEAD",
        "mean": 1.6124281712400002,
        "stddev": 0.01736026161101964,
        "median": 1.60791875154,
        "user": 0.8879778999999999,
        "system": 0.81957544,
        "min": 1.58471221554,
        "max": 1.63595784554
      }
    ]
  }
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 204.9 ± 9.6 194.3 227.4 2.32 ± 0.12
pacquet@main 212.3 ± 11.4 199.2 233.1 2.40 ± 0.14
pnpr@HEAD 91.8 ± 2.5 87.0 95.2 1.04 ± 0.03
pnpr@main 88.5 ± 1.7 85.5 93.8 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.20488601025333333,
      "stddev": 0.00959819084189176,
      "median": 0.20270820842,
      "user": 0.20487634,
      "system": 0.07864292333333334,
      "min": 0.19432115042,
      "max": 0.22740748642
    },
    {
      "command": "pacquet@main",
      "mean": 0.21227868399142855,
      "stddev": 0.011418424752995865,
      "median": 0.20678838292,
      "user": 0.2132427685714286,
      "system": 0.07296841142857144,
      "min": 0.19919104942000002,
      "max": 0.23310114142
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09179205395333331,
      "stddev": 0.0024695825226418847,
      "median": 0.09240336392000001,
      "user": 0.035488306666666664,
      "system": 0.013155739999999999,
      "min": 0.08696561942000001,
      "max": 0.09516091342
    },
    {
      "command": "pnpr@main",
      "mean": 0.08848066780709679,
      "stddev": 0.0017061027486193316,
      "median": 0.08790813642,
      "user": 0.029938888387096775,
      "system": 0.012643683870967742,
      "min": 0.08554769242000002,
      "max": 0.09382122142
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 643.4 ± 57.9 567.5 742.8 1.01 ± 0.13
pacquet@main 638.1 ± 61.8 557.6 761.7 1.00
pnpm@HEAD 3061.7 ± 198.2 2878.8 3499.8 4.80 ± 0.56
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6433571422666667,
      "stddev": 0.05790992573114399,
      "median": 0.6256228796000001,
      "user": 0.6676238866666666,
      "system": 0.1472559377777778,
      "min": 0.5675283156,
      "max": 0.7428450766000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.6380886261555556,
      "stddev": 0.061817159488535965,
      "median": 0.6303510826000001,
      "user": 0.6591444422222222,
      "system": 0.14448915999999998,
      "min": 0.5576143326,
      "max": 0.7616980946
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.0616846970444445,
      "stddev": 0.1981833565942451,
      "median": 2.9729248546,
      "user": 4.7132883311111105,
      "system": 0.22653671555555555,
      "min": 2.8787566545999996,
      "max": 3.4997848416
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 303.6 ± 15.6 274.3 321.9 1.03 ± 0.12
pacquet@main 295.3 ± 32.0 227.6 334.9 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.3035557011,
      "stddev": 0.015631139691353765,
      "median": 0.3074396359,
      "user": 0.24782566,
      "system": 0.13983674,
      "min": 0.2743049684,
      "max": 0.3219407824
    },
    {
      "command": "pacquet@main",
      "mean": 0.29529118470000004,
      "stddev": 0.03198788846515215,
      "median": 0.3014078834,
      "user": 0.24726536000000002,
      "system": 0.12751524,
      "min": 0.22759896940000002,
      "max": 0.33485591540000004
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.425 ± 0.113 4.300 4.634 1.29 ± 0.05
pacquet@main 4.381 ± 0.115 4.320 4.704 1.28 ± 0.05
pnpr@HEAD 3.436 ± 0.126 3.364 3.779 1.00 ± 0.05
pnpr@main 3.428 ± 0.113 3.363 3.740 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.4247480027,
      "stddev": 0.11335223811123553,
      "median": 4.3957296644,
      "user": 1.50708186,
      "system": 1.5645996,
      "min": 4.3000598774,
      "max": 4.6338269234
    },
    {
      "command": "pacquet@main",
      "mean": 4.3810341427,
      "stddev": 0.11475799712378539,
      "median": 4.3518449309000005,
      "user": 1.4015041600000002,
      "system": 1.4125709000000002,
      "min": 4.3202874744,
      "max": 4.7041575664
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.4364283547999994,
      "stddev": 0.12564205761107028,
      "median": 3.3901293794000003,
      "user": 1.2425359599999999,
      "system": 1.2927484000000002,
      "min": 3.3639395644,
      "max": 3.7786485314
    },
    {
      "command": "pnpr@main",
      "mean": 3.4278338962,
      "stddev": 0.11255775797068054,
      "median": 3.3942062834,
      "user": 1.25482886,
      "system": 1.3056246,
      "min": 3.3634690854,
      "max": 3.7402298114
    }
  ]
}

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 119.3 ± 5.1 113.0 133.8 1.01 ± 0.06
pacquet@main 118.4 ± 5.7 111.8 130.1 1.00
pnpr@HEAD 133.1 ± 3.3 127.5 139.5 1.12 ± 0.06
pnpr@main 144.4 ± 5.2 137.0 154.8 1.22 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.11927563375619046,
      "stddev": 0.005096104894444315,
      "median": 0.11764439228000001,
      "user": 0.1518009761904762,
      "system": 0.12913763904761902,
      "min": 0.11300323728,
      "max": 0.13375965228000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.11842782959818182,
      "stddev": 0.005720870184601199,
      "median": 0.11656628828000001,
      "user": 0.1494615909090909,
      "system": 0.12502820181818183,
      "min": 0.11175801028,
      "max": 0.13006429328000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.13305892185894738,
      "stddev": 0.0033233597790403202,
      "median": 0.13307401528,
      "user": 0.15881813157894734,
      "system": 0.13658896736842102,
      "min": 0.12750156128,
      "max": 0.13947615528
    },
    {
      "command": "pnpr@main",
      "mean": 0.14436797164842108,
      "stddev": 0.005164901888532714,
      "median": 0.14344030028000002,
      "user": 0.1722172894736842,
      "system": 0.14263670421052635,
      "min": 0.13702369128000003,
      "max": 0.15479901928000003
    }
  ]
}

@zkochan
zkochan merged commit 90e5159 into pnpm:main Sep 26, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On Windows, pnpm 12 skips a dependency's build script on a side-effects cache hit when the package ships an executable file

4 participants