Skip to content

Commit

Permalink
Merge pull request #7 from pendo-io/shuffle-perf
Browse files Browse the repository at this point in the history
perf(rrweb): optimize random shuffled addList
  • Loading branch information
colingm authored Oct 4, 2023
2 parents 718539c + 33fe6fa commit 8b156f8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/rrweb/src/record/mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,13 @@ export default class MutationBuffer {
if (this.processedNodeManager.inOtherBuffer(n, this)) return;

// if n is added to set, there is no need to travel it and its' children again
if (this.addedSet.has(n) || this.movedSet.has(n)) return;
if (this.addedSet.has(n)) {
// update the order of added nodes in addedSet for the `emit` phase
this.addedSet.delete(n);
this.addedSet.add(n);
return;
}
if (this.movedSet.has(n)) return;

if (this.mirror.hasNode(n)) {
if (isIgnored(n, this.mirror)) {
Expand Down

0 comments on commit 8b156f8

Please sign in to comment.