Drop dprof.json.gz here.
npm install dprof
node -r dprof my-script.js
Content of my-script.js:
const fs = require('fs');
fs.open(__filename, 'r', function (err, fd) {
let count = 0;
const a = new Buffer(10);
fs.read(fd, a, 0, 10, 0, function (err2) {
if (++count === 2) close();
});
const b = new Buffer(10);
fs.read(fd, b, 0, 10, 10, function (err2) {
if (++count === 2) close();
});
function close() {
fs.close(fd, function (err) {
});
}
});
View using gzcat dprof.json.gz | dprof, or use the online viewer (try this example).