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.

PNPM is a new nodejs package manager like npm and yarn. Today I’m campers nextjs installation time in npx and pnpm.

npx use by default yarn to install the nextjs. For the time stamp, I’m using the Linux time command. time the command tells the actual uses of programs time and summarises system resource usage time.

https://linuxize.com/post/linux-time-command/

Installation of pnpm

I’m testing pnpm base on two parameters.

  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.

I install more than 6 to 8 new projects with npx and pnpm. Every time the size new installation folder is the same.

In pnpm, maybe the size of the folder is reduced in the other package. But nextjs, it does not work.

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.

The test result is not the same every time. Lots more factors affect npx and pnpm. I test on online cloud IDE is test changes. But one thing is considered the time of pnpm is very less as compared to npx for the first installation.

In one case, pnpm takes less time when we install a new project, and the project package does not have any per caches stored in the machine.

The second time, npx, yarn, and pnpm take store cache locally in the machine. It takes the same and equal time for the new installation of the nextjs project.

--

--

--

Nextjs Publication is an unofficial publication of Nextjs. Our goal is to bring beginners and pro developer in one place, and everybody understands the basic concept of next.js.

Recommended from Medium

Angular 7 Http Mock Interceptors

Getting Naked with Angular Reactive Forms

Setting up Windows 10 for JavaScript development

I’m building yet another tasks extension for Chrome

My journey towards competitive programming using Javascript

VS Code extensions for react-native

Arrays in JavaScript

How to use authentication in full stack web app built with ReactJS and HapiJS using JWT : Part 1

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

Rajdeep singh

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

More from Medium

Add Typescript to an existing NextJS Project in 5 mins

NextJS Static Render & Performance

Chopping a monorepo. From Heroku to Heroku and Next.js

Error Boundary for Next.js API routes