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

Investigate memoizing getRole #3170

Open
straker opened this issue Sep 28, 2021 · 1 comment
Open

Investigate memoizing getRole #3170

straker opened this issue Sep 28, 2021 · 1 comment
Labels
performance Performance related issues

Comments

@straker
Copy link
Contributor

straker commented Sep 28, 2021

We should do a performance audit on axe.commons.aria.getRole and see if we should memoize it. It's used heavily throughout the code and there are potential places where it can be called on the same element multiple times (and hundreds of times in some cases).

For example, in #3160 we need to look at the role of the parent table element of every row. On a site like https://web.archive.org/web/20190613132353/https://giveawaylisting.com/, that's hundreds to thousands of times the getRole function is called on the same element.

@LudwikJaniuk
Copy link

Looks interesting... following.
(I've been thinking if there are other things that could be memoized... perhaps involving links being repeated over a page?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance related issues
Projects
None yet
Development

No branches or pull requests

2 participants