-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yarn is very quick only from the third invocation #2054
Comments
Seems to be reaching steady state.
|
It doesn't appear to be deterministic. Looks like a bug. |
I'm investigating it. The reproduction behavior is not stable: sometimes it runs quickly on the second time, sometimes on third time:
Seems like this bug is related to |
Even if that's the case each subsequent yarn invocation should yield the same node_modules as bound by the constraints in yarn.lock (which doesn't change between runs). But in the second run many modules are changing versions and relative location in the modules hierarchy. For the second yarn invocation why must yarn perform an internet operation at all? Since all the constraints should have been satisfied by the first run it should behave as if it had the |
While testing, I've encountered a non-reproducible error:
Definitely something weird is going on... |
My findings so far: FYI, I'm using the following command to check the differences between yarn invocations:
|
I'll be able to take another look at the weekend, if nobody comes up with a solution. |
I'm encountering the same behavior with Second invocation of $ time yarn install
yarn install v0.18.1
[1/4] Resolving packages...
[2/4] Fetching packages...
warning [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning Incorrect peer dependency "webpack@^2.1.0-beta.19".
[4/4] Building fresh packages...
Done in 181.94s. Third invocation of $ time yarn install
yarn install v0.18.1
[1/4] Resolving packages...
success Already up-to-date.
Done in 4.92s. Please mention your node.js, yarn and operating system version. Node - 6.9.3 |
I've recently seen this behaviour as well. I can repeatedly reproduce it with the following
The problem happens with no lock file:
But with the lock file present it works as expected:
Please mention your node.js, yarn and operating system version. |
@IgorAufricht that is a great point. This issue only happens if the project does not have a |
I believe the issue I'm seeing is the same as this (ie if Observations that may be useful:
STR: $ rm -rf node_modules/ yarn.lock
$ yarn
yarn install v0.21.3
info No lockfile found.
[1/4] Resolving packages...
warning grunt-html-angular-validate > html-angular-validate > globule > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning grunt-html-angular-validate > html-angular-validate > globule > glob > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
[2/4] Fetching packages...
warning [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 22.63s.
$ sha256sum yarn.lock
0486e32773a05778347a00906c14f29a47cc69eae60c75bd442353fde6a699c2 yarn.lock
$ cat node_modules/.yarn-integrity; echo
964b624365d4fec753e0c96ff9b323122a5f6a9f4f23242f3fc0db26bbdfbe9d
$ yarn
yarn install v0.21.3
[1/4] Resolving packages...
[2/4] Fetching packages...
warning [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 6.99s.
$ sha256sum yarn.lock
0486e32773a05778347a00906c14f29a47cc69eae60c75bd442353fde6a699c2 yarn.lock
$ cat node_modules/.yarn-integrity; echo
aefe649c0b8eb9cf85bb7ac951dca0764e161f9cf007de6e869c536a9b7c93d3
$ yarn
yarn install v0.21.3
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.87s.
$ sha256sum yarn.lock
0486e32773a05778347a00906c14f29a47cc69eae60c75bd442353fde6a699c2 yarn.lock
$ cat node_modules/.yarn-integrity; echo
aefe649c0b8eb9cf85bb7ac951dca0764e161f9cf007de6e869c536a9b7c93d3 |
I was able to reduce that testcase to: {
"devDependencies": {
"browserify": "^13.1.1",
"eslint": "3.8.0",
"watchify": "^3.8.0"
}
} Note: In addition to
|
Thanks for the repro steps. |
This appears to be the fix: #3729 |
Do you want to request a feature or report a bug?
A performance issue, maybe a bug.
What is the current behavior?
Running
yarn
on a project with nonode_modules
and the yarn cache cleared gets quick (<1s) only from the third try forward.If the current behavior is a bug, please provide the steps to reproduce.
These are timings on https://github.com/angular/angular.js/:
What is the expected behavior?
It should be quick from the second try.
Performance is one thing but what worries me most is that yarn is supposed to be idempotent on a project with already installed dependencies and a populated cache (which should happen during the first run). So where does this delay come from?
Please mention your node.js, yarn and operating system version.
Node 6.9.1, yarn 0.17.9, macOS 10.12.1 (16B2555)
The text was updated successfully, but these errors were encountered: