-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
perf(mutation): refactor parent removed detection to iterative procedure #1489
Conversation
🦋 Changeset detectedLatest commit: 57ed19c The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Good catch Jonas, could you add a changeset, then I'll merge it |
@Juice10 sounds good, I just added the patch changeset. Let me know if there is anything else I can do |
I think there is something up with gh ci, that check if failing on a network timeout |
@Juice10 Mind restarting CI here, I cant seem to be able to trigger it (unless you want me to push an empty commit here) |
@JonasBa sure! |
…ure (rrweb-io#1489) * perf(mutation): add deep tree benchmark * perf(mutation): use iterative procedure * perf(mutation): run formatter * perf(mutation): add changeset
…ure (rrweb-io#1489) * perf(mutation): add deep tree benchmark * perf(mutation): use iterative procedure * perf(mutation): run formatter * perf(mutation): add changeset
…ure (rrweb-io#1489) * perf(mutation): add deep tree benchmark * perf(mutation): use iterative procedure * perf(mutation): run formatter * perf(mutation): add changeset
…ure (rrweb-io#1489) * perf(mutation): add deep tree benchmark * perf(mutation): use iterative procedure * perf(mutation): run formatter * perf(mutation): add changeset
…ure (rrweb-io#1489) * perf(mutation): add deep tree benchmark * perf(mutation): use iterative procedure * perf(mutation): run formatter * perf(mutation): add changeset
While looking at some profiles on an adjacent PR, I noticed that we were spending a lot of time inside isParentRemoved.
I added a benchmark to cover a new deep tree test.
Largest change is on the deep tree benchmark I added which went from 475.5 to 377.4ms, the rest looks more or less the same.
Before
console.log
┌─────────┬────────────────────────────────────────────────────────┬───────────────────────────────────────────┬─────────────────────┬───────┬──────────┬────────────────────────────────────────────────────┐
│ (index) │ title │ html │ eval │ times │ duration │ durations │
├─────────┼────────────────────────────────────────────────────────┼───────────────────────────────────────────┼─────────────────────┼───────┼──────────┼────────────────────────────────────────────────────┤
│ 0 │ 'create 1000x 1 DOM nodes with deeply nested children' │ 'benchmark-dom-mutation-deep-nested.html' │ 'window.workload()' │ 10 │ 475.5 │ '481, 461, 488, 477, 470, 514, 449, 471, 472, 472' │
└─────────┴────────────────────────────────────────────────────────┴───────────────────────────────────────────┴─────────────────────┴───────┴──────────┴────────────────────────────────────────────────────┘
After
console.log
┌─────────┬────────────────────────────────┬───────┬────────────────────┬────────────────────┐
│ (index) │ title │ times │ duration │ durations │
├─────────┼────────────────────────────────┼───────┼────────────────────┼────────────────────┤
│ 0 │ 'append 70 x 70 x 70 elements' │ 3 │ 1320.3333333333333 │ '1366, 1299, 1296' │
└─────────┴────────────────────────────────┴───────┴────────────────────┴────────────────────┘
console.log
┌─────────┬────────────────────────────────────────────────────────┬───────────────────────────────────────────┬─────────────────────┬───────┬──────────┬────────────────────────────────────────────────────┐
│ (index) │ title │ html │ eval │ times │ duration │ durations │
├─────────┼────────────────────────────────────────────────────────┼───────────────────────────────────────────┼─────────────────────┼───────┼──────────┼────────────────────────────────────────────────────┤
│ 0 │ 'create 1000x 1 DOM nodes with deeply nested children' │ 'benchmark-dom-mutation-deep-nested.html' │ 'window.workload()' │ 10 │ 377.4 │ '385, 369, 398, 366, 373, 369, 376, 410, 359, 369' │
└─────────┴────────────────────────────────────────────────────────┴───────────────────────────────────────────┴─────────────────────┴───────┴──────────┴────────────────────────────────────────────────────┘