8000 fix: restore performance for large amount of child nodes by karfau · Pull Request #760 · xmldom/xmldom · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: restore performance for large amount of child nodes #760

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

Merged
merged 2 commits into from
Oct 13, 2024

Conversation

karfau
Copy link
Member
@karfau karfau commented Oct 13, 2024

as part of #550 ("drop redundant and broken Element.appendChild implementation")
the _onUpdateChild was not passed the added child, so the childNodes were "re-indexed" from the firstChild each time a node was appended.
This is why the performance degraded significantly, when there are a lot of childNodes to be appended.

fixes #748

as part of #550
("drop redundant and broken `Element.appendChild` implementation")
the `_onUpdateChild` was not passed the added child,
so the `childNodes` were re-indexed from the `firstChild` each time a node was appended.

Now that the added child is being passed,
the performance in 0.9.0 is still not as good as in 0.8.*,
but this is because of the higher amount of checks being executed before adding a node.

fixes #748
Copy link
codecov bot commented Oct 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.05%. Comparing base (8db2ae3) to head (33845ef).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #760      +/-   ##
==========================================
+ Coverage   95.01%   95.05%   +0.04%     
==========================================
  Files           8        8              
  Lines        2165     2165              
  Branches      569      569              
==========================================
+ Hits         2057     2058       +1     
+ Misses        108      107       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@karfau karfau added this to the 0.9.4 milestone Oct 13, 2024
@karfau karfau merged commit 5705f5d into master Oct 13, 2024
38 checks passed
@karfau karfau deleted the fix-performance-regression branch October 13, 2024 22:40
karfau added a commit that referenced this pull request Oct 23, 2024
to resolve a regression introduced in #760

fixes #763
karfau added a commit that referenced this pull request Oct 26, 2024
to resolve a regression introduced in #760

fixes #763
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.

degraded performance of Node.appendChild whith increasing amount of nodes appended
1 participant
0