You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yarn delay for scripts is too big comparing to npm
macos:
wroud@wroud client % time yarn echo
ok
yarn echo 0.28s user 0.05s system 120% cpu 0.266 total
wroud@wroud client % time yarn echo
ok
yarn echo 0.28s user 0.04s system 130% cpu 0.243 total
wroud@wroud client % time npm run echo
> echo
> echo 'ok'
ok
npm run echo 0.09s user 0.03s system 83% cpu 0.141 total
wroud@wroud client %
wroud@wroud client % time yarn echo2
ok
yarn echo2 0.78s user 0.11s system 84% cpu 1.058 total
this is actual for any composite script like 'tsc -b && yarn bundle'
comparing to npm:
"scripts": {
"echo": "echo 'ok'",
"echo2": "npm run echo",
}
wroud@wroud client % time npm run echo2
> echo2
> npm run echo
> echo
> echo 'ok'
ok
npm run echo2 0.18s user 0.05s system 91% cpu 0.249 total
To reproduce
I use monorepo with pnp (but switching to node_modules have no effect)
script is "echo": "echo 'ok'",
Delay is really noticible. It also affects all comands not only scripts.
It's critical when runned in ci/cd or with combination 'yarn workspaces foreach`
[@wroud/preconditions]: Process started
[@wroud/preconditions]: Tag already exists: preconditions-v0.2.1
[@wroud/preconditions]: Time: 34
[@wroud/preconditions]: Process exited (exit code 0), completed in 1s 367ms
here you can see that script itself executed in 34ms when total time is 1367ms
when directly executed:
wroud@wroud di % time yarn ci git-tag --prefix di-v
Tag already exists: di-v0.15.1
Time: 36
yarn ci git-tag --prefix di-v 0.88s user 0.12s system 128% cpu 0.771 total
Self-service
Describe the bug
Yarn delay for scripts is too big comparing to npm
macos:
windows (powershell):
nesting:
this is actual for any composite script like 'tsc -b && yarn bundle'
comparing to npm:
To reproduce
I use monorepo with pnp (but switching to node_modules have no effect)
script is
"echo": "echo 'ok'",
Delay is really noticible. It also affects all comands not only scripts.
It's critical when runned in ci/cd or with combination 'yarn workspaces foreach`
here is an example: https://github.com/Wroud/foundation/actions/runs/12098355117/job/33734738575
you can see that "Release" and "Tag" steps took almost the same time
here you can see that script itself executed in 34ms when total time is 1367ms
when directly executed:
Environment
System: OS: macOS 15.1 CPU: (12) arm64 Apple M2 Pro Binaries: Node: 22.11.0 - /private/var/folders/hr/z2pjf65s3yj3nlwq3zxff1n00000gn/T/xfs-1edaafc0/node Yarn: 4.5.3 - /private/var/folders/hr/z2pjf65s3yj3nlwq3zxff1n00000gn/T/xfs-1edaafc0/yarn npm: 10.9.0 - /usr/local/bin/npm pnpm: 8.11.0 - ~/Library/pnpm/pnpm
Additional context
No response
The text was updated successfully, but these errors were encountered: