Replies: 3 comments 4 replies
-
In my personal benchmarking, I see low number of syscalls for yarn modern. System information$ hostnamectl
...
Operating System: Amazon Linux 2
CPE OS Name: cpe:2.3:o:amazon:amazon_linux:2:-:internal
Kernel: Linux 5.4.172-100.336.amzn2int.x86_64
Architecture: x86-64
$ node -v
v16.13.2
$ npm init vite@2.7.2
✔ Project name: … vite-project
✔ Select a framework: › vue
✔ Select a variant: › vue-ts
$ cd vite-project && git init && git add. && git commit -am "Initial commit" npm v8.1.2: cold - 66912, warm - 9116$ git clean -dfx && git checkout .
$ npm --version
8.1.2
$ time strace -c npm install
...
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
...
------ ----------- ----------- --------- --------- ----------------
100.00 0.275250 66912 1924 total
strace -c npm install 2.44s user 1.67s system 126% cpu 3.263 total
$ time strace -c npm install
...
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
...
------ ----------- ----------- --------- --------- ----------------
100.00 0.011384 9116 1876 total
strace -c npm install 0.54s user 0.17s system 98% cpu 0.721 total yarn v3.1.1: cold - 1386, warm - 864$ git clean -dfx && git checkout .
$ yarn set version stable
➤ YN0000: Retrieving https://repo.yarnpkg.com/3.1.1/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-3.1.1.cjs
➤ YN0000: Done in 0s 353ms
$ yarn --version
3.1.1
$ time strace -c yarn
...
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
...
------ ----------- ----------- --------- --------- ----------------
100.00 3.916271 1386 33 total
strace -c yarn 47.57s user 3.96s system 158% cpu 32.482 total
$ time strace -c yarn
...
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
...
------ ----------- ----------- --------- --------- ----------------
100.00 0.048544 864 31 total
strace -c yarn 0.86s user 0.06s system 144% cpu 0.640 total pnpm v6.29.1: cold - 32890, warm - 5798$ git clean -dfx && git checkout .
$ pnpm --version
6.29.1
$ time strace -c pnpm install
...
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
...
------ ----------- ----------- --------- --------- ----------------
100.00 0.145973 32890 280 total
strace -c pnpm install 1.61s user 0.91s system 121% cpu 2.080 total
$ time strace -c pnpm install
...
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
...
------ ----------- ----------- --------- --------- ----------------
100.00 0.022651 5798 159 total
strace -c pnpm install 0.65s user 0.17s system 111% cpu 0.738 total |
Beta Was this translation helpful? Give feedback.
-
Benchmarks with node_modules + central store mode for yarn and pnpm based on discussions in discord thread: System information$ hostnamectl
...
Operating System: Amazon Linux 2
CPE OS Name: cpe:2.3:o:amazon:amazon_linux:2:-:internal
Kernel: Linux 5.4.172-100.336.amzn2int.x86_64
Architecture: x86-64
$ node -v
v16.13.2
$ npm init vite@2.7.2
✔ Project name: … vite-project
✔ Select a framework: › vue
✔ Select a variant: › vue-ts
$ cd vite-project && git init && git add. && git commit -am "Initial commit" yarn v3.1.1: cold - 221068, warm - 37702$ git clean -dfx && git checkout .
$ yarn set version stable
➤ YN0000: Retrieving https://repo.yarnpkg.com/3.1.1/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-3.1.1.cjs
➤ YN0000: Done in 0s 353ms
$ sed -i -e 's/^/compressionLevel: 0\nenableGlobalCache: true\nnodeLinker: node-modules\nnmMode: hardlinks-global\n\n/' .yarnrc.yml
$ yarn --version
3.1.1
$ time strace -c -f yarn
...
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
...
------ ----------- ----------- --------- --------- ----------------
100.00 35.051901 221068 13692 total
strace -c -f yarn 4.33s user 3.58s system 147% cpu 5.354 total
$ time strace -c -f yarn
...
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
...
------ ----------- ----------- --------- --------- ----------------
100.00 5.470758 37702 3699 total
strace -c -f yarn 1.26s user 0.62s system 152% cpu 1.235 total pnpm v6.29.1: cold - 74734, warm - 28430$ git clean -dfx && git checkout .
$ echo 'node-linker=hoisted' > .npmrc
$ pnpm --version
6.29.1
$ time strace -c -f pnpm install
...
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
...
------ ----------- ----------- --------- --------- ----------------
100.00 4.355469 74734 8987 total
strace -c -f pnpm install 1.75s user 1.03s system 117% cpu 2.368 total
$ time strace -c -f pnpm install
...
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
...
------ ----------- ----------- --------- --------- ----------------
100.00 1.895735 28430 1936 total
strace -c -f pnpm install 1.08s user 0.44s system 129% cpu 1.173 total Npm cannot use central store, so there can't be a fair comparison. |
Beta Was this translation helpful? Give feedback.
-
Created an issue at #4057 after the discussions in Discord thread. |
Beta Was this translation helpful? Give feedback.
-
Update: Created an issue at #4057 after the discussions in Discord thread.
The blog post on In-depth of tnpm rapid mode.
In this blog post the author sees yarn@3.1.1 making ~4X syscalls as compared to pnpm/tnpm as shown in the screenshot below.
Screenshot
Creating this issue to reproduce the issue, and discuss fixes if it's reproducible.
Related twitter thread: https://twitter.com/arcanis/status/1486059029235388418
Beta Was this translation helpful? Give feedback.
All reactions