Why is the Performance score of an empty, default NextJS Application so low?

Viewed 1687

I started playing around with my first Next.js project.

After creating a new project via create-next-app, I ran the performance-tab in the web-app 'Lighthouse' (the results can be viewed in the tabs below). The performance report returned a score of 79, however; all the other test were above 90.

Can someone explain to me why these are the results?

The project is newly created, and totally empty, one would assume a performance report to return a great score for such a project, but it did not. If you have any insight that could help to clarify why the performance test is returning with the results that I explained above, it will be appreciated. Thank you!

Performance Results Image(a)

Performance Results Image(b)

1 Answers

I think you are running the test on the development server. In the development mode, there are a lot of unused js codes are being used. That's why the performance is a bit slow. You can check the production build.

All you have to do is:

  1. run npm build
  2. npm start (if your dev server is running on port 3000, then run npm start -p 5000)
  3. then go to http://localhost:5000 and run the lighthouse. I think the performance will be better.
Related