improve rrdom performance (#1127)
* add more check to rrdom to make diff algorithm more robust * fix: selector match in iframe is case-insensitive add try catch to some fragile points * test: increase timeout value for Jest * improve code style * fix: failed to execute insertBefore on Node in the diff function this happens when ids of doctype or html element are changed in the virtual dom also improve the code quality * refactor diff function to make the code cleaner * fix: virtual nodes are passed to plugin's onBuild function * refactor the diff function and adjust the order of diff work. * call afterAppend hook in a consistent traversal order * improve the performance of the "contains" function reduce the complexity from O(n) to O(logn) a specific benchmark is needed to add further * add a real events for benchmark * refactor: change the data structure of childNodes from array to linked list * remove legacy code in rrweb package * update unit tests * update change log
This commit is contained in:
10
.changeset/serious-ants-juggle.md
Normal file
10
.changeset/serious-ants-juggle.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
'rrdom': major
|
||||
'rrdom-nodejs': major
|
||||
'rrweb': patch
|
||||
---
|
||||
|
||||
Refactor: Improve performance by 80% in a super large benchmark case.
|
||||
|
||||
1. Refactor: change the data structure of childNodes from array to linked list
|
||||
2. Improve the performance of the "contains" function. New algorithm will reduce the complexity from O(n) to O(logn)
|
||||
Reference in New Issue
Block a user