Skip to content

Conversation

@Jeka-Vasiliev
Copy link

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