Nextjs
Published in

Nextjs

Nextjs + PNPM ( performant nodejs package manager )

Benchmark in pnpm package manager with nextjs

Check which is fast npx and pnpm to install nextjs.

Installation of pnpm

  1. Size
  2. Caches

Size

One thing is very odd for me that is the size of the fresh install nextjs project with npx and pnpm. The size of npx and pnpm is the same. I think pnpm helps reduce the size of a new project, but it does not work as I expected.

Caches

First, install nextjs without caches and see how much nextjs take time to install with pnpm and npx. The second time we install nextjs and see how much it takes time to install nextjs.

PNPM and NPX base benchmark using the nextjs package.
PNPM and NPX base benchmark using the nextjs package.

NPX benchmark without caches

rajdeepsingh@officialrajdeepsingh:~/working$ time npx create-next-app@latest
real 8m26.886s
user 0m55.394s
sys 0m27.210s

PNPM benchmark without caches

rajdeepsingh@officialrajdeepsingh:~/working$ time pnpm create next-app
real 2m36.691s
user 0m28.880s
sys 0m6.290s

PNPM benchmark with caches

rajdeepsingh@officialrajdeepsingh:~/working$ time pnpm create next-app 
real 1m32.419s
user 0m8.758s
sys 0m2.464s

NPX benchmark with caches

rajdeepsingh@officialrajdeepsingh:~/working$ time npx create-next-app@latest
real 1m53.513s
user 0m10.031s
sys 0m4.523s

Faq

Why I’m comparing nextjs base of npx and pnpm

Many developers use npx to install nextjs in daily life, and the nextjs team recommended using npx to start a new or fresh project.

Summaries

For small projects, it does not matter what should use npx or pnpm. Both work the same. If your work folder is big, then I recommend using pnpm in your nextjs project.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rajdeep singh

JavaScript || Reactjs || Nextjs || Python || Rust || Biotechnology || Bioinformatic || Front-end Developer || Writer || https://officialrajdeepsingh.dev/