cpuprofile
Version:
A simple representation of .cpuprofile files.
40 lines (25 loc) • 965 B
Markdown
A simple representation of .cpuprofile files.
```
npm install --save cpuprofile
```
```javascript
const Profile = require('cpuprofile').Profile;
// read and parse a .cpuprofile file
let content = require('fs').readFileSync('prof.cpuprofile', {encoding: 'utf8'});
let parsed = JSON.parse(content);
// create Profile
let profile = Profile.createFromObject(parsed);
// generate formatted overview on self and total times
let output = profile.formattedBottomUpProfile();
```
- `Profile` and `ProfileNode` classes.
- Generation of Bottom Up Profiling view of Chrome DevTools.
- [Alexei Filippov](mailto:alph@chromium.org): Thanks for pointing me in the right direction!
- [Chromium](https://chromium.googlesource.com/): The calculation of self and total times is adapted from parts of the Chromium project.
Copyright © 2016 by Sebastian Ruhleder. Released under the MIT license.