Skip to content

Add ability to measure performance of individual rules #1437

@btmills

Description

@btmills

As I've worked on perf improvements or implementing new rules in the past, I've found it useful to be able to see where significant time is being spent within rules with greater specificity than the overall view given by npm run perf. Does anyone else think this would be useful functionality?

I decided to push up my local timing branch to show what I'm doing. If there's interest, I can put together a PR. Since aggregating timing data incurs performance penalty outside of the rules, it only runs when I enable it. For example, to see the ten longest-running rules on the ESLint source code:

$ TIMING=1 eslint lib
camelcase: 51ms (6.3%)
no-irregular-whitespace: 42ms (5.2%)
no-multi-spaces: 40ms (5.0%)
valid-jsdoc: 40ms (4.9%)
handle-callback-err: 30ms (3.7%)
no-undefined: 24ms (2.9%)
space-infix-ops: 23ms (2.9%)
no-caller: 22ms (2.8%)
no-empty-class: 21ms (2.6%)
semi: 18ms (2.2%)

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbuildThis change relates to ESLint's build processenhancementThis change enhances an existing feature of ESLint

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions