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
Exploration: Drop yarn in favour of npm #8718
Conversation
This seems to work great! One thing I can suggest here is to add npm caching to Travis configuration. It's currently set up to cache files that |
Yarn is still faster than npm for me: https://github.com/Viper007Bond/npm-yarn-benchmark
EDIT: That was with 10 runs. |
It's strange, my results are the opposite:
|
Okay, maybe my Internet and laptop just suck then. Good to know. 👍 |
@Viper007Bond thanks for the code there. I got a copy of the benchmark tool but it didn't run on my mac ( But I'm interested about what results you get if you don't |
You probably don't have |
Also I ran this on my WP.com sandbox as I didn't trust Windows Subsystem for Linux speed. Here's the results (with the default 3 runs):
|
|
Hmm, maybe an old version that doesn't support the needed flags? /shrug
|
yeah, |
I didn't realize that you updated the benchmark.sh to install Jetpack dependencies, went to clone the repo blindly and ran it on my sandbox... ...5 years have passed now, the benchmark has finished and I can confirm that it looks like yarn did it faster here. I would still like to check something because the times for npm using cache and npm not using cache were exactly the same. I don't know what happened there. |
So, I decided to write up a bit more of benchmark in C# using the native bit of windows:
It looks like it's massively io-bound (which makes sense, it does a little bit of downloading, a little bit of copying, etc, etc). npm is io-bound regardless of cache. It doesn't "think" too much. Windows helps exacerbate this due to it's "filesystem safety" that lacks the concept of file descriptors or symlinks in *nix. Anyway, if you see npm being consistently faster, you have some fast disks because that's the only thing holding it back! Yarn tends to "think about it" and once the files are cached, gets the job done faster than npm. For *nix users, we're talking a few seconds here, a few seconds there. For people with slow drives, or crappy filesystems, you could be talking about minutes, which should (in theory) make yarn the default choice for now. |
I think we should remove the dependency on yarn.
Let's ditch yarn 🎉 |
This PR probably needs updating to include some of the new yarn scripts that were added for docker |
We are currently considering switching to In light of that, I've got a couple question for Jetpackers:
|
What do you mean? I was under the impression that was all handled magically when you use the add/remove commands in yarn. As for offline mode, I'm never offline, but the cache is hugely useful (although I guess npm has that now too?). |
Thats enough evidence for me 😆. |
Disclaimer: Requires testing for confirmation. I may be wrong. 😉 |
Closing |
Changes proposed in this Pull Request:
yarn
as the benefits by whichyarn
was chosen are implemented innpm
now.Testing instructions:
Proposed changelog entry for your changes: