When I add a new package to an existing installation where yarn install
has already been run, it takes 5 minutes to add a new dependency, which is as slow as if I just did yarn install
without node_modules
there yet.
Is this normal?
I'm using Yarn 0.17.9 on Windows 10 x64. I did make Windows Defender ignore my project directory and yarn global cache directories.
EDIT: here are some benchmark results I did. Based on them, it seems that yarn add is actually 30-40% faster, and the real issue is rather just that yarn is 500% slower on Windows
EDIT 2: I have confirmed that indexing hasn't been enabled for the project and yarn cache directories. But now I have upgraded yarn from 0.16.1 to 0.17.9 and there was a 35-50% increase in speed in Windows! But it's still 350-400% slower than in Linux. I have updated the benchmarks.
There seems to be Github issue for the Windows performance issues: https://github.com/yarnpkg/yarn/issues/990
The benchmark:
--
Windows - yarn install (cached):
Done in 172.29s.
Ubuntu - yarn install (cache):
yarn install 48,75s user 11,32s system 117% cpu 51,161 total
--
Windows - yarn add lodash:
Done in 143.11s.
Ubuntu - yarn add lodash:
yarn add lodash 33,42s user 5,72s system 108% cpu 36,203 total
--
FYI the Ubuntu benchmarks were run on the same folder on the NTFS drive.
Project that was used for the benchmarks: https://github.com/amcsi/szeremi
question from:
https://stackoverflow.com/questions/40566222/yarn-5x-slower-on-windows 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…