clinicjs / node-clinic

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

Missing traces when using kernel-tracing #443

Open RafaelGSS opened 1 year ago

RafaelGSS commented 1 year ago

V8 might have changed how it behaves with --perf-basic-prof.

Example:

import fs  from 'node:fs'
// File with URLs
const contents = fs.readFileSync('./out-positive.txt', 'utf8').split('\n').filter(l => l.length > 3)

let result = 0

// warmup
for (let content of contents) {
  result = new URL(content).toString().length
}

process._rawDebug('benchmark starts')

for (let content of contents) {
  result = new URL(content).toString().length
}

If someone else wants to investigate it before me, use the out-positive.txt.

Note: you can't compare the result with Node.js <= v18 because URL has changed in v19. You should compare it against other profilers (pprof, CDT, Apple Instrument, linux_perf)