-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Improve mutation processing performance #1652
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
Open
eoghanmurray
wants to merge
29
commits into
rrweb-io:master
Choose a base branch
from
eoghanmurray:pushAddOrder
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
43c5d72
Iterate over the added nodes in 'one pass' so that we don't need to b…
eoghanmurray ed757b3
Test changes, rearrangement of mutations
eoghanmurray 1d8b37b
Add some ids as I'm interested in tracing these nodes through pushAdd…
eoghanmurray 99da1e4
Do away with the second pass as we can handle shadow DOM in the first…
eoghanmurray 490aea9
Performance oriented refactor focusing on scenario where a large numb…
eoghanmurray d9587d4
Satisfy typescript which could be smarter here ... we can guarantee t…
eoghanmurray 2a0eedd
Utilize `lastChild` to avoid possibly crawling through hundreds of nodes
eoghanmurray 96ea20d
We've already got `nextSibling` here so can skip a step and avoid the…
eoghanmurray 2aa8597
Test rearrangements in the adds array due to new algorithm; should be…
eoghanmurray 8d4e766
We were calling `inDom` in all cases, so don't do the other ancestor …
eoghanmurray 3b33611
Don't think we're explicitly looking at the slimdom stuff in relation…
eoghanmurray f260c0d
Add changeset
eoghanmurray 87b091a
Don't think `main` subfolder was ever used as an output target; this …
eoghanmurray 1441ef3
Placate eslint (`while(true)` is a Pythonism rather than do..while) -…
eoghanmurray b5b04e2
Forgot to add the mutation.html file - also add doctype
eoghanmurray 720e174
Simplify the parentId check, doesn't need to ever by null
eoghanmurray c166319
Move mutation tests into their own files to demonstrate an idea which…
eoghanmurray 4a751ee
Apply formatting changes
eoghanmurray 7734331
Some inconsequential tests to cover blocking scenarios
eoghanmurray 4c2af79
Was trying to 'catch out' the mutation handling by having siblings pr…
eoghanmurray 8b27440
fixup! Move mutation tests into their own files to demonstrate an ide…
eoghanmurray 453beb0
I can't recreate a scenario for this case in testing, so add a warnin…
eoghanmurray 03f2146
Put each snap file in it's own folder and shorten names
eoghanmurray 9666d32
Satisfy eslint
eoghanmurray e90b18b
Repeat the mutation tests but with the blocking/ignored nodes already…
eoghanmurray 9a7a47e
Indicate that replay no longer needs the queue, as added nodes should…
eoghanmurray f9f660c
Merge branch 'master' into pushAddOrder
Juice10 7d39bbc
Update packages/rrweb/src/replay/index.ts
eoghanmurray 0b0d662
Update packages/rrweb/src/record/mutation.ts
eoghanmurray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
We were calling
inDom in all cases, so don't do the other ancestor …
…checks if it goes bad early
- Loading branch information
commit 8d4e766d9cd82712ee6b94887c614015f9797adb
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess the casts to Node are to avoid
!!parentNode.lastChild && x.has(parentNode.lastChild)i think safe here but
as Xis such a source of bugs that it always scares me 🙈There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya, typescript sees
new Set<Node>(), so wants to only allow Nodes in thehasfunction, whereas .lastChild can returnnull. However the.has(null)on a Javascript Set will returnfalsewhich is fine. We don't wantnulls in the set, so preventing.add(null)makes sense, however the error on the.hasis a bit too strict for my taste.