forked from rrweb-io/rrweb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: record processMutation (rrweb-io#1214)
* perf: record processMutation * Create mean-tips-impress.md * Apply formatting changes
- Loading branch information
1 parent
cc326a1
commit 33b8e5b
Showing
4 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'rrweb': patch | ||
--- | ||
|
||
perf: optimize the performance of record in processMutation phase |
This file contains 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
This file contains 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
18 changes: 18 additions & 0 deletions
18
packages/rrweb/test/html/benchmark-dom-mutation-multiple-descendant-add.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<html> | ||
<body></body> | ||
<script> | ||
function addMultiNodes() { | ||
const total = 1000; | ||
let parent = document.body; | ||
for (let i = 0; i < total; i++) { | ||
const el = document.createElement('div'); | ||
el.textContent = `el-${i + 1}`; | ||
parent.append(el); | ||
parent = el; | ||
} | ||
} | ||
window.workload = () => { | ||
addMultiNodes(); | ||
}; | ||
</script> | ||
</html> |