Skip to content

Optimize large list performance #250

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

Merged
merged 2 commits into from
Feb 18, 2021
Merged

Conversation

Jeka-Vasiliev
Copy link
Contributor

Optimized rendering of a large list of nodes.
The problem was that with checking any node of the tree, all nodes were re-rendered, even if they did not change.
The solution to this problem is quite simple: make the node component a pure one and make sure that the props of this component are not re-created on every rendering.

Impact on performance.

Measured on a tree of 2100 visible nodes. OS: Windows 10 x64 with Ryzen 5 2600 3.40 GHz

Before

620-650 ms
image

After

160-180 ms
image

@jakezatecky jakezatecky merged commit 622ddef into jakezatecky:master Feb 18, 2021
@jakezatecky
Copy link
Owner

Thanks for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants