Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(perf-timer): add instrumentation for Rule.runChecks #701

Merged
merged 1 commit into from
Jan 31, 2018

Conversation

paulirish
Copy link
Contributor

@paulirish paulirish commented Jan 29, 2018

When running things with perfTimer, I noticed sometimes there was significant cost within the runChecks methods, however that wasn't always obvious from the existing performanceTimer measures.

This adds instrumentation around the runChecks methods.

One note is that the intrumentation is synchronous, however checks finish asynchronously. But in my experience, it appears the majority of the cost happens in the first bit of synchronous runChecks work. So this seems OK.

Screenshot including the nontrivial cost of runchecks-duplicate-id:

image

This patch doesn't pass JSHint. I'm interested in your suggestions on handling that.

@CLAassistant
Copy link

CLAassistant commented Jan 29, 2018

CLA assistant check
All committers have signed the CLA.

@dylanb
Copy link
Contributor

dylanb commented Jan 29, 2018

@paulirish you can get rid of the JSHint errors by hiking the var definitions up to the top of the function.

@paulirish
Copy link
Contributor Author

you can get rid of the JSHint errors by hiking the var definitions up to the top of the function.

thanks, done.

@dylanb
Copy link
Contributor

dylanb commented Jan 29, 2018

As an FYI - the async code only runs when you are analyzing pages with iframes, so for the purposes of most perf testing, this code should be sufficient.

Thanks for the contribution!!

@dylanb dylanb self-requested a review January 29, 2018 21:32
@dylanb
Copy link
Contributor

dylanb commented Jan 29, 2018

@WilcoFiers @marcysutton do we care about the commit log subject being "perf:"? We haven't used this before but I am ok with us adopting this going forward - WDYT?

@marcysutton
Copy link
Contributor

perf: sounds appropriate to me. I'm not 100% sure if conventional-changelog will include those commits in the automated changelog (they are allowed). We could always test it to find out.

@WilcoFiers
Copy link
Contributor

perf: doesn't show in the changelog. I think a 25% performance boost should be in feat.

@dylanb
Copy link
Contributor

dylanb commented Jan 30, 2018

@WilcoFiers this just adds the rule information to the performance timer functionality

@paulirish
Copy link
Contributor Author

retitled as "chore(performance): ". sgty?

@WilcoFiers WilcoFiers merged commit 27fdc2f into dequelabs:develop Jan 31, 2018
@paulirish paulirish deleted the perftimer branch January 4, 2019 01:26
WilcoFiers pushed a commit that referenced this pull request Jan 18, 2019
With performanceTimer on, we get some nice usertiming measures added. But in #701, some _jerk_ picked an endpoint for rules that I, personally, think can be improved. :)

This moves the end mark of each rule to when the checks have synchronously finished. This change means we don't include the asynchronous bit afterwards, but that async bit is the subject of #1172.

For accurate timing, it makes more sense to keep these measures synchronous. It also makes reading the flame chart more logical.

Screenshots of before and after:
![image](https://user-images.githubusercontent.com/39191/50669976-6f0d9300-0f7d-11e9-8f60-24122a577084.png)



## Reviewer checks

**Required fields, to be filled out by PR reviewer(s)**
- [x] Follows the commit message policy, appropriate for next version
- [x] Has documentation updated, a DU ticket, or requires no documentation change
- [x] Includes new tests, or was unnecessary
- [x] Code is reviewed for security by: @WilcoFiers
mrtnvh pushed a commit to mrtnvh/axe-core that referenced this pull request Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants