Skip to content
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 node replace algorithm #20

Merged
merged 1 commit into from
Feb 3, 2018
Merged

Conversation

diogofcunha
Copy link
Owner

@diogofcunha diogofcunha commented Feb 3, 2018

Same profiling on Large Collection example(increasing the number of rendered nodes to be ~230k) showed the following results:

replaceNodeFromTree

master

image

For a simple action replaceNodeFromTree takes ~500ms to run, this makes the UI look strange

here

image

As the image shows the time that replaceNodeFromTree takes to run is now residual and the burden is on getFlattenedTree

It means that the next step will be to try to add some kind of memoization to getFlattenedTree so that it only needs flatten the strictly necessary nodes and keep the old ones in memory while still possible

@codecov-io
Copy link

Codecov Report

Merging #20 into master will decrease coverage by 0.98%.
The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #20      +/-   ##
==========================================
- Coverage   97.47%   96.49%   -0.99%     
==========================================
  Files          14       14              
  Lines         119      114       -5     
==========================================
- Hits          116      110       -6     
- Misses          3        4       +1
Impacted Files Coverage Δ
src/selectors/nodes.js 96.15% <92.85%> (-3.85%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc3f89f...55d4df7. Read the comment docs.

@diogofcunha
Copy link
Owner Author

Optimizations for getFlattenedTree seem irrelevant and premature at this moment in time, 250k elements is a fair number of nodes to support at this moment in time.

@diogofcunha diogofcunha merged commit 951b5e4 into master Feb 3, 2018
@diogofcunha diogofcunha deleted the new-node-replace-algorithm branch February 3, 2018 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants