eslint/eslint — pull request #1446 by btmills (2014-11-06 18:29:08+00:00)
Title: (WIP) New: Add ability to time individual rules (fixes #1437)

My timing branch is to the point where I'd like some input and feedback before this gets merged. Right now the output format is a listing of the ten most expensive rules, their running time, and relative performance cost as a percentage of total rule processing time. I have three major questions that I'd like to open up to the community:

1. I'm not sure if this is the right format. Should it be an ASCII table? Generate an HTML file with full data?
1. How does one test a specific rule? Right now, if I'm trying to test a rule that doesn't appear in the top (or bottom?) ten, I don't see its performance data.
1. Timing is triggered by the `TIMING` environment variable. Should it be a CLI option, a differently-named environment variable, something else entirely...?

```bash
$ TIMING=1 eslint lib
no-irregular-whitespace: 54ms(7.2%)
camelcase: 42ms(5.6%)
valid-jsdoc: 41ms(5.4%)
no-multi-spaces: 37ms(5.0%)
handle-callback-err: 28ms(3.7%)
no-undefined: 22ms(2.9%)
space-infix-ops: 20ms(2.7%)
no-spaced-func: 20ms(2.6%)
no-empty-class: 18ms(2.4%)
semi: 17ms(2.2%)
```