[Bug]: Yarn workspace foreach
is considerably slower compared to other alternatives
#3562
Labels
bug
Something isn't working
Self-service
Describe the bug
I have a yarn workspace with around 20 packages. When I run a simple echo test —
It takes 14-15 seconds for
echo
to execute. I have 6 physical cores.This is a lot compared to me running this directly through bash, or using other utilities like —
https://www.npmjs.com/package/workspaces-run
which take under 1 second here.
To reproduce
Unfortunately, I wasn't able to create a minimal repro for this. If I try to emulate the same workspace structure in a fresh project, I am not able to achieve the same high command execution times for
yarn workspace foreach exec
.I did notice however, that increasing parallelism makes the performance worse. For example, on increasing this to parallel of
40
, it takes 18+ seconds to execute.I also noticed that when I run this, a
node
process with 150% CPU usage throughout the lifetime of the run appears.This is strange, because the executed command itself isn't CPU intensive at all.
Environment
Additional context
No response
The text was updated successfully, but these errors were encountered: