Skip to content

Commit

Permalink
Close #489 PR: Add additional profiling recommendations .
Browse files Browse the repository at this point in the history
  • Loading branch information
jamestalmage authored and sindresorhus committed Jan 30, 2016
1 parent 9f1a38e commit 0316047
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion maintaining.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,31 @@

## Profiling

You should first install [`iron-node`](https://github.com/s-a/iron-node) and / or [`devtool`](https://github.com/Jam3/devtool) globally:

```
$ npm install --global iron-node devtool
```

In the root of a project using AVA, run:

```
$ iron-node node_modules/ava/profile.js <test-file>
```

After `iron-node` has loaded, activate the Dev Tools profiling, and then hit <kbd>Cmd</kbd> <kbd>R</kbd> to rerun the tests.
Or:

```
$ devtool node_modules/ava/profile.js <test-file>
```

Once the Dev Tools window has loaded, activate Memory or CPU profiling, and then hit <kbd>Cmd</kbd> <kbd>R</kbd> to rerun the tests.

As soon as the tests finish, stop the recording and inspect the profiler results. The flamegraph can be displayed by choosing `Chart` from the drop down on the `Profiles` tab (other views include `Tree (top down)` and `Heavy (bottom up)`).

You may also want to check out the Settings page in Dev Tools and enable one or more options in the Profiling section.

##### Helpful resources

- [An introduction to Node.js debugging with `devtool`](http://mattdesl.svbtle.com/debugging-nodejs-in-chrome-devtools).
- [A video introduction to Chrome DevTools CPU and Memory profiling](https://www.youtube.com/watch?v=KKwmdTByxLk).

0 comments on commit 0316047

Please sign in to comment.