-
-
Notifications
You must be signed in to change notification settings - Fork 231
Open
Description
Is it worthy to move to pnpm and reduce carbon emissions ?
WIP PR in #2765
Criteria
- Time on CI and ability to start in warm cache
- Vercel deployment time and size
- Easy to maintain versions of the pm in ci, docker... (corepack will help in the future but not yet)
- Easy ways to build a docker image
- Best integration with tools like nx, turbo
Checklist
Tested on this monorepo with nextjs 12.3.1. At first sight pnpm is faster, but going into details... not sure.
Check | Yarn 4rc | Pnpm 7 | Winner |
---|---|---|---|
Laptop (cold cache) | 71.410 ± 1.835 | 34.696 ± 1.413 | pnpm (x2) |
Laptop (warm cache) | 21.576 ± 0.390 | 10.780 ± 0.881 | pnpm (x2) |
Github action (cold) | ±2m | ±1m20 | pnpm (x1.8) |
Github action (warm) | ±1m20 | ±50s | pnpm (x1.3) |
Vercel (warm) | ±2m20 | ±3m30s | yarn |
Vercel (ssr lambda size) | 25MB (8.88Mb) | 50MB (25Mb zip) | yarn |
Vercel (api routes) | 68Mb (22Mb zip) | 49.4 MB (22.6Mb zip) | pnpm |
- Yarn is slower in ci & local but with the automatic rotation of its cache, it's run always (mostly) warm everywhere. So the difference is not huge. The warm cache works also in vercel.
- Yarn is commited in the github repo. No need to take care of different versions on CI, Github, local machines... Install is reproducible
- Vercel deployments/previews are slower (couldn't make pnpm cache as good as yarn).
- Lambdas size differs a lot... need more investigations (vercel/nft...)
PS: locally bench were done with hyperfine, timings on github are based on few runs and include the install and the action/cache (de-)compression. As yarn already compress the archives, the post compression is very fast (zstd is disabled for files that does not compress)
Links
- Benchmarks local & CI: https://gist.github.com/belgattitude/0ecd26155b47e7be1be6163ecfbb0f0b
- Vercel time and lambda size: https://gist.github.com/belgattitude/38bc4b779d14d17793316c936879f06e
- Pnpm action used: https://gist.github.com/belgattitude/838b2eba30c324f1f0033a797bab2e31
- Yarn action used: https://gist.github.com/belgattitude/042f9caf10d029badbde6cf9d43e400a
tea-artist, jtlapp, remy90, jkhaui, liamrohan and 4 more
Metadata
Metadata
Assignees
Labels
No labels