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

Performance Issue - css query selectors - forced reflow is a likely performance bottleneck #168

Open
JRJurman opened this issue Jul 21, 2021 · 2 comments

Comments

@JRJurman
Copy link
Member

Summary

When building the performance tests for #167 , I realized that even the input would become slow when lots of elements were on the page. In the performance tab on chrome, I saw the following warning:
forced reflow is a likely performance bottleneck screenshot

You can see, that there are two purple blocks, both with the warning "forced reflow is a likely performance bottleneck". As detailed on stack overflow this issue stems from using querySelectorAll, which require the DOM to be fully rendered before the JS logic can continue. We do this in several places and should look into alternatives that are more performant.

@JRJurman
Copy link
Member Author

Right now we are using querySelectorAll as a shortcut to get the children of an element, but maybe we should use TreeWalkers or just recursively go through the DOM (even recursive JS may prove to be more performant)

@JRJurman JRJurman self-assigned this Jul 24, 2021
@JRJurman
Copy link
Member Author

JRJurman commented Aug 6, 2021

Asked this on stack-overflow, so we'll see if we get an answer there - https://stackoverflow.com/questions/68675817/how-can-i-group-javascript-actions-that-force-reflow

Other than that, there is #169 which should tackle all the querySelectorAll parts of the project

@JRJurman JRJurman removed their assignment Aug 6, 2021
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

No branches or pull requests

1 participant