Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ managers
versions.json

samples
.claude
21 changes: 14 additions & 7 deletions benchmarkFixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,10 @@ export function pnpmWorkspaceYaml (opts = {}) {
}

/**
* Undoes an install. Yarn PnP writes no `node_modules` at all, so removing only
* that would leave its whole installation in place and hand the scenario that
* follows a project that is already installed.
* Undoes an install. Yarn Berry can write installation state outside
* `node_modules` (the PnP artifacts, its own metadata), so removing only
* `node_modules` would hand the scenario that follows a project that is
* partly installed already.
*/
function removeInstallOutput (cwd, modules) {
if (modules) {
Expand Down Expand Up @@ -269,9 +270,6 @@ export default async function benchmark (pm, fixture, opts) {
+ 'nmMode: hardlinks-local\n'
+ 'compressionLevel: 0\n'
break
case 'yarn_pnp':
yarnRc += 'nodeLinker: pnp\n'
break
}
await fs.writeFile(path.join(cwd, '.yarnrc.yml'), yarnRc)
}
Expand Down Expand Up @@ -390,7 +388,12 @@ export default async function benchmark (pm, fixture, opts) {
// lockfile and no `node_modules` go with it, or the fast managers would
// short-circuit and warm nothing, which is how the imbalance arose in the
// first place.
const rewarmDir = path.join(cwd, '.rewarm')
// A sibling of the project, not a directory inside it: Yarn walks up from
// wherever it runs and refuses to install in a directory nested under a
// project that doesn't declare it ("doesn't seem to be part of the project
// declared in ..."), so the throwaway copy has to live where no project
// sits above it.
const rewarmDir = path.join(path.dirname(cwd), `${path.basename(cwd)}.rewarm`)
rimraf.sync(rewarmDir)
await fs.mkdir(rewarmDir, { recursive: true })
try {
Expand All @@ -406,6 +409,10 @@ export default async function benchmark (pm, fixture, opts) {
if (err?.code !== 'ENOENT') throw err
}
}
// For Yarn this drops an empty lockfile in place, the same project-root
// marker every scenario below relies on (see `cleanLockfile`); for the
// others it is a no-op on a directory that has no lockfile to remove.
cleanLockfile(pm, rewarmDir, env)
// The cache dir may not exist right now: it was deleted two rows up, and
// a manager whose `node_modules` row is a registry-free no-op (pnpm
// restores the tree from the lockfile copy inside it) never recreated
Expand Down
9 changes: 0 additions & 9 deletions commandsMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,6 @@ export default {
'install'
]
},
yarn_pnp: {
scenario: 'yarn_pnp',
legend: 'Yarn PnP',
color: '#40a9ff',
name: 'yarn',
args: [
'install'
]
},
bun: {
scenario: 'bun',
legend: 'Bun',
Expand Down
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ const pmConfigs = [
// between the two.
{ key: 'pnpm_pnpr' },
{ key: 'yarn' },
{ key: 'yarn_pnp', hasNodeModules: false },
{ key: 'bun' },
]
const pms = pmConfigs.map(({ key }) => key)
Expand Down Expand Up @@ -305,7 +304,6 @@ async function measure () {
authToken: registry.authToken,
},
yarn: { managersDir: managersDirs.yarn },
yarn_pnp: { managersDir: managersDirs.yarn },
bun: { managersDir: managersDirs.bun },
}
// A column with nowhere to install from would otherwise fail eight minutes
Expand Down Expand Up @@ -375,7 +373,7 @@ async function writePage ({ formattedNow, registryVersion, sections, svgs, sorte

**Last benchmarked at**: _${formattedNow}_ (_daily_ updated).

This benchmark compares the performance of npm, pnpm, Yarn, Yarn PnP, and Bun (check [Yarn's benchmarks](https://yarnpkg.com/benchmarks) for any other Yarn modes that are not included here). Every package manager installs through the same [pnpr](https://pnpm.io/pnpr) registry (v${registryVersion}) across an emulated ${ROUND_TRIP_MS}ms round trip at ${BANDWIDTH_MBPS} Mbit/s, so they all face one registry over one reproducible network instead of whatever link the benchmark machine happens to have. pnpm 12 is measured twice: once on its own, and once resolving its dependency graph [on the server](https://pnpm.io/pnpr/install-acceleration) instead of walking it itself. The page also compares how fast pnpm, fnm, and nvm install and switch Node.js versions.
This benchmark compares the performance of npm, pnpm, Yarn, and Bun (check [Yarn's benchmarks](https://yarnpkg.com/benchmarks) for PnP and any other Yarn modes that are not included here). Every package manager installs through the same [pnpr](https://pnpm.io/pnpr) registry (v${registryVersion}) across an emulated ${ROUND_TRIP_MS}ms round trip at ${BANDWIDTH_MBPS} Mbit/s, so they all face one registry over one reproducible network instead of whatever link the benchmark machine happens to have. pnpm 12 is measured twice: once on its own, and once resolving its dependency graph [on the server](https://pnpm.io/pnpr/install-acceleration) instead of walking it itself. The page also compares how fast pnpm, fnm, and nvm install and switch Node.js versions.

About the setup:

Expand Down Expand Up @@ -456,7 +454,6 @@ async function benchmarkFixtures ({ pmCommands, formattedNow, nodeVersion, runFi
secondaryKey: 'pnpm11',
},
{ ...pmCommands.yarn, key: 'yarn' },
{ ...pmCommands.yarn_pnp, key: 'yarn_pnp' },
{ ...pmCommands.bun, key: 'bun' },
]
const resArray = sortedTests.map(test => mainBars.map(bar => bar.stacked
Expand Down
2 changes: 0 additions & 2 deletions regenerate-svgs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ const pmConfigs = [
{ key: 'pnpm11' },
{ key: 'pnpm12' },
{ key: 'yarn' },
{ key: 'yarn_pnp', hasNodeModules: false },
{ key: 'bun' },
]

Expand Down Expand Up @@ -142,7 +141,6 @@ const mainBars = [
secondaryKey: 'pnpm11',
},
{ ...cmdsMap.yarn, key: 'yarn' },
{ ...cmdsMap.yarn_pnp, key: 'yarn_pnp' },
{ ...cmdsMap.bun, key: 'bun' },
]
.filter(bar => bar.stacked
Expand Down
30 changes: 0 additions & 30 deletions results/yarn_pnp/1.16.0/alotta-files.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions results/yarn_pnp/1.16.0/angular-quickstart.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions results/yarn_pnp/1.16.0/ember-quickstart.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions results/yarn_pnp/1.16.0/medium-size-app.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions results/yarn_pnp/1.16.0/react-app.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions results/yarn_pnp/1.17.3/alotta-files.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions results/yarn_pnp/1.17.3/angular-quickstart.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions results/yarn_pnp/1.17.3/ember-quickstart.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions results/yarn_pnp/1.17.3/medium-size-app.yaml

This file was deleted.

Loading