Skip to content

Instantly share code, notes, and snippets.

@slavafomin
Last active May 17, 2018 08:50
Show Gist options
  • Save slavafomin/00861f9c9f60a4d56ac86680c800b7be to your computer and use it in GitHub Desktop.
Save slavafomin/00861f9c9f60a4d56ac86680c800b7be to your computer and use it in GitHub Desktop.
npm 5 vs yarn

npm 5 vs yarn

Looks like npm decided to stand up to yarn by releasing npm version 5, which is announced to be 5 times faster than previous version of npm.

I've decided to test it in one of my projects, the results are below:

Performance Benchmark

I've used three different versions of package managers and series of 10 installations, then I've calculated the average values.

During all my tests I've deleted the resulted files, cleared the cache and deleted lock-files.

Results

  • npm 4.6.1 — 57s

  • npm 5.0.0 — 24s

  • yarn 0.24.6 — 15s

  • npm 5 is 2.4 times faster than npm 4

  • yarn is 3.8 times faster than npm 4

  • yarn is 1.6 times faster than npm 5

So, it looks like npm overestimated they performance improvements at least 2x times. And yarn is still fastest package manager at the moment, so I'm going to stick with it.

@leebenson
Copy link

Could you post a copy of your package.json here please?

I'm curious if any of your dependencies have postinstall scripts that Yarn isn't running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment