clinicjs / node-clinic

Clinic.js diagnoses your Node.js performance issues
https://clinicjs.org
MIT License
5.67k stars 125 forks source link

Running Bulletproof on a Next.js build produces an unexpected result #464

Open alfonsograziano opened 9 months ago

alfonsograziano commented 9 months ago

I created a simple Next.js application with a single page. The page is dynamic and contains an await of 1000ms before showing content to the user.

Expected Behavior

By running clinic doctor --autocannon [ / --method GET ] -- node ./node_modules/.bin/next start after the build, Doctor correctly recognize an issue in the cpu usage, suggesting to use Bulletproof to find the bottleneck.

Screenshot 2024-01-03 at 13 32 01

Current Behavior

At this point, I try to run clinic bulletproof --autocannon [ / --method GET ] -- node ./node_modules/.bin/next start and the analysis produces this graph. I'm not sure if that's the expected result, but it is not very helpful in identifying potential issues. I'm not sure if Bulletproof is just not the best tool for performing this type of analysis on Next.js or if this is an actual bug in the graph generation. I'll investigate a little bit

Screenshot 2024-01-03 at 13 33 47

Steps to Reproduce

  1. Clone this repo
  2. Build the appwith npm run build
  3. Run clinic bulletproof --autocannon [ / --method GET ] -- node ./node_modules/.bin/next start

Environment