admin管理员组

文章数量:1410724

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!

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!

Share edited May 6, 2021 at 5:53 AKUMA no ONI 12.1k8 gold badges64 silver badges102 bronze badges asked Mar 27, 2021 at 10:08 Marco MazzaiMarco Mazzai 673 silver badges18 bronze badges 5
  • 1 All of the suggestions are out there. Please search on google for each topic and you'll get ways to resolve the issue. I've done the same to my projects. – Zunayed Shahriar Commented Mar 27, 2021 at 10:12
  • You're right, I changed the title and description. – Marco Mazzai Commented Mar 27, 2021 at 10:29
  • This is a fine question @MarcoMazzai. And it deserves an answer from the Google Lighthouse team if you ask me. – serraosays Commented Apr 28, 2021 at 22:19
  • 2 Do you have the react developer tools addon installed? For me that's the reason for Remove unused JavaScript. Also, are you using the dev server or the production build? – arkuuu Commented Apr 29, 2021 at 7:56
  • Your questions is really relevant. Next should be better, faster, on a fresh project. That means that we must work more on every project to try to "clean" next things. Would be better to have a "performance ready" next. – Tiago Gouvêa Commented May 1, 2021 at 18:17
Add a ment  | 

1 Answer 1

Reset to default 7 +50

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.

本文标签: