-
Notifications
You must be signed in to change notification settings - Fork 23
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
Bootstrap takes 60 seconds to run even when nothing has changed #42
Comments
Thanks for your report! I'm not sure what's causing the long intervals in your case. I'm on OS X and Could you please check whether it's Phase 1 or Phase 2 of the second While it won't help you speeding up CI times, you may want to use |
Hi, thank you for the quick reply!
How long do the first/second bootstraps take for Neutrino on your machine, using the STR from above? (So we can rule out platform as an issue)
From the timestamps in the pastebin linked above, it looks like phase 1 is taking 48 seconds and phase 2 is 14 seconds. Of note for phase 1:
|
I confirm that I can reproduce your findings on OS X:
I did another test replacing all executions of Now, I could address some parallelisations, both for Pass 1 and Pass 2, but it may take a little while (a month at most, I guess). Right now I don't have much time… I'll keep you posted! |
Thank you for looking into this more.
Unless the yarn "done in X seconds" output is incorrect, I'm struggling to see where else the time is being spent. The test using Lines 67 to 74 in 3098ab0
Perhaps replacing |
Profiling using 0x generated this flamegraph: At first glance I see storyboard taking 23% of the profile, inquirer 14% and Steps for using 0x: sudo apt-get install linux-tools-generic linux-tools-`uname -r`
sudo npm install -g 0x
./node_modules/.bin/oao clean
./node_modules/.bin/oao bootstrap
0x node ./node_modules/.bin/oao bootstrap
0x -c gen profile-2808/stacks.2808.out > flamegraph.html |
Indeed, yarn's reported time seems to err on the low side:
|
If all goes well, |
|
Just released v0.8.3:
Perf comparison:
cc @eliperelman |
Wow! 👏 I'll give this a shot asap! |
@eliperelman Btw, I'm also seeing the error reported by @edmorley in neutrinojs/neutrino#251, so it shouldn't be Lerna's fault. |
@guigrpa didn't oao used to symlink peerDependencies if they were part of packages? |
Ah I see now, for some reason when I ran |
If there is a failure during the bootstrap process, the package.jsons aren't reverted and end up being replaced with versions that exclude the local peerDependency. |
@guigrpa also, if I remove everything: rm -rf node_modules yarn.lock packages/*/node_modules packages/*/yarn.lock I constantly fail the bootstrap process, most likely because of some concurrency issue trying to install the same package multiple times with possibly different hashes. These could be related: |
Do you believe it is an issue with yarn then? (If it can be of any help, you can temporarily disable parallelism in the |
In any case, I will investigate why package.jsons are not reverted if an error occurs. In principle, this was handled by the code. |
My guess is the problems were caused by too much concurrency and yarn wasn't able to handle it and caused some conflicts. You might be able to replicate by checking out neutrino and removing all node_modules and yarn.locks. |
…kage.json` files always, even if one of the subpackages fails to install (#42).
Yes, I've had no problem reproducing it. It happens systematically on Neutrino. Strangely enough, it doesn't happen on Storyboard, which has around 14 subpackages and lots of cross-dependencies. Regarding the fact that oao didn't recover the original package.jsons, I've found the problem. When one of the branches of the parallel bootstrap failed, the program terminated too soon. I have released a patch (v0.8.4) that waits for all pending promises to resolve before throwing the error. |
Have you had a look at yarn's issues with concurrency? Do you think they're widespread? Would you recommend switching parallel bootstrap off (except for |
Oh, FYI, I had a similar issue and the reason is that I had It was basically cyclical. What I learned was:
|
@edmorley @eliperelman oao now has support for Yarn Workspaces; you can try it out in
Note that workspaces are still experimental in yarn (0.28+) and behind a flag ( In principle, this would solve both the performance issue (no overhead wrt. bare-bones yarn) and the concurrency issue described above, so I'm closing this issue. Please send your feedback on the new oao feature! |
STR:
git clone https://github.com/mozilla-neutrino/neutrino-dev
cd neutrino-dev && git checkout 13adea32550de2f1eae9ae79f2980f8a2f6b5e82
yarn install
(this installs oao v0.8.0)yarn bootstrap
(which runsoao bootstrap
from the localnode_modules
)yarn bootstrap
Expected:
The second time bootstrap is run, the duration is significantly less than the first, ideally <5-10s.
Actual:
The first bootstrap took 125 seconds (see https://emorley.pastebin.mozilla.org/9024429), the second still took 63 seconds (see https://emorley.pastebin.mozilla.org/9024430), even though it had nothing to do.
This also affects us on Travis, since it means caching the sub-package's node_modules gives little time saving (and in fact quite a disadvantage, given travis-ci/travis-ci#7898) - see neutrinojs/neutrino#248.
Do you have any ideas as to what might be causing this?
Many thanks!
The text was updated successfully, but these errors were encountered: