Closed eps1lon closed 4 years ago
@eps1lon I am going to do the full testing and accept this change if it doesn't produce regressions. Thank you for the suggestion.
@eps1lon
the commit has been pushed, your suggestion about the test in isHTML() seems adequate.
I also removed two or three .toLowerCase()
since they were not necessary any more.
Not much speed gain, but surely an improvement even in nwsapi
speed itself.
Curious about the gain we should see in jsdom
which is were this started.
Looking forward to comments and more improvements/adjustments.
Curious about the gain we should see in jsdom which is were this started.
We had pretty big gains in @testing-library/react
in getComputedStyle
heavy methods. We're now caching tagName
(used by nodeName
) in jsdom
which lead to up to 40% reduced runtime. Caching tagName
and nwsapi
using localName
are basically equivalent. https://github.com/jsdom/jsdom/pull/3008 has more context (including a benchmark repo).
@eps1lon the commit has been pushed,
What commit? I see this PR now has conflicts. Should I resolve these and is there anything else I should be doing?
@eps1lon
sorry for the mess ... I did things as I should have done from the beginning.
Accepted your pull request ... I will add the small difference in another commit.
After so many changes and error, I believe I would better do a git rebase
too when all the new commits are in place.
No worries. Whatever makes your life easier.
Due to heave usage of
getComputedStyle
injsdom
we discovered thatElement.prototype.nodeName
was a bottleneck. It seems like this isn't the correct property to use for selectors butElement.prototype.localName
(which is way cheaper injsdom
).See:
-- @domenic https://github.com/jsdom/jsdom/pull/3008#issuecomment-670952380
It isn't clear to me how to test these changes extensively. I quickly verified it in
./test/jquery/jquery
,./test/html5/
,./test/slick/Runner/runner
(all in Chrome 84) and by using this PR injsdom
'syarn test-wpt
. All test suites still pass with these changes.