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: skip unnecessary access to cssText property #164

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

autologie
Copy link
Contributor

While investigating slow tests in my project written with React + Chakra UI, I found out that calling the get accessor of cssText property takes up a large portion of total execution time. This PR is to skip such calls when possible by making _onChange calls conditional.

In my project, I saw ~40% improvement of the execution time (24sec → 15sec).

@domenic
Copy link
Member

domenic commented Nov 9, 2023

Nice! It's not clear which weekend I'll have time to do another round of jsdom releases, but I am excited to merge this (after testing it with the full jsdom test suite) as soon as I do have such time.

@autologie
Copy link
Contributor Author

Hi @domenic, thank you for taking care of that.
Looking forward to getting this verified and released :)

@domenic domenic merged commit 180cab1 into jsdom:master Dec 28, 2023
4 checks passed
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.

2 participants