Skip to content

Commit 6d12fee

Browse files
jamestalmagesindresorhus
authored andcommitted
Close #489 PR: Add additional profiling recommendations .
1 parent 9f1a38e commit 6d12fee

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

maintaining.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,28 @@
2727

2828
## Profiling
2929

30+
You should first install [`iron-node`](https://github.com/s-a/iron-node) and / or [`devtool`](https://github.com/Jam3/devtool) globally:
31+
32+
```
33+
$ npm install --global iron-node
34+
$ npm install --global devtool
35+
```
36+
3037
In the root of a project using AVA, run:
3138

3239
```
3340
$ iron-node node_modules/ava/profile.js <test-file>
41+
# or
42+
$ devtool node_modules/ava/profile.js <test-file>
3443
```
3544

36-
After `iron-node` has loaded, activate the Dev Tools profiling, and then hit <kbd>Cmd</kbd> <kbd>R</kbd> to rerun the tests.
45+
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.
46+
47+
As soon as the tests finish, stop the recording and inspect the profiler results. The flame chart can be displayed by choosing `Chart` from the drop down on the `Profiles` tab (other views include `Tree (top down)` and `Heavy (bottom up)`).
48+
49+
You may also want to check out the Settings page in Dev Tools and enable one or more options in the Profiling section.
50+
51+
Helpful Resources:
52+
53+
- [An introduction to Node.js debugging with `devtool`](http://mattdesl.svbtle.com/debugging-nodejs-in-chrome-devtools).
54+
- [A video introduction to Chrome DevTools CPU and Memory profiling](https://www.youtube.com/watch?v=KKwmdTByxLk).

0 commit comments

Comments
 (0)