-
-
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
Improve mutation processing performance #1652
base: master
Are you sure you want to change the base?
Conversation
…acktrack; pushAdd requires that each new node has a parentId and a nextId
…er of child nodes share the same parent
…hat if a possibly null node is in e.g. this.addedSet, then it is indeed not null. Similarly if `this.addedSet.size` is non zero, then we can pop confidently
… confusing initialization to `IGNORED_NODE`
… equivalent but might have implications in terms of how replay should iterate over them
…checks if it goes bad early
… to mutation processing
…was preventing benchmark test from running
🦋 Changeset detectedLatest commit: 7fde788 The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 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 |
I've cloned the plunker from #1302 from @mdellanoce The microtasks run after the jstree work is done, and I'm clocking 3.2s for those before this PR vs. 2.2s after. |
… could also use `checkLoops: allExceptWhileTrue` after eslint upgrade
… could be applied across all snapshots. Also, only mutation events are relevant here (reduce burden when manually expecting test output). Also (commented out) showing how to reuse expected output between tests, i.e. assert that two tests produce same output
…esent on mutation processing before they could be added, but couldn't (deliberately) break anything. Adding test anyway as it might throw up an interesting scenario
…a which could be applied across all snapshots. Also, only mutation events are relevant here (reduce burden when manually expecting test output). Also (commented out) showing how to reuse expected output between tests, i.e. assert that two tests produce same output
…g and a speculative mitigation
Here's the benchmark output (please replicate on other machines):
|
Refactor record time mutation processing to improve performance
this.addedSet
so that we start with nodes which already have the requirednextId
andparentId
This solves pathological cases where nodes from the addedSet were pushed onto the secondary addList, possibly multiple times as
pushAdd
was called again each time the nextId/parentId requirements weren't met.Previous efforts in this direction were
Also related is #1277 "refactor recursive procedure to iterative" which we could also incorporate on top of this as it should provide orthogonal performance gains — in order to 'grasp the nettle' all at once in terms of possible breakage.