fix: restore performance for large amount of child nodes#760
Merged
Conversation
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
karfau
added a commit
that referenced
this pull request
Oct 26, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
as part of #550 ("drop redundant and broken
Element.appendChildimplementation")the
_onUpdateChildwas not passed the added child, so thechildNodeswere "re-indexed" from thefirstChildeach time a node was appended.This is why the performance degraded significantly, when there are a lot of childNodes to be appended.
fixes #748