Skip to content

Tree performance for 70K items #9626

@imjhonny

Description

@imjhonny

Provide a general summary of the issue here

Current project we need to have 70K items in a Tree and we can't use async load.

Tree takes a bit to load which is ok but handling the click event takes 549.23 ms

When I check the performance in chrome tools this events cause rerenders:

  • focus: focus seems to trigger the entire state to change and is slow
  • click: 479ms, TreeInner seems to be rerendering several times because of useDragAndDrop
Image

Curent Tree has no drag and drop props. Would be great if we could avoid that extra process that makes it slow

🤔 Expected Behavior?

Fast onClick update

😯 Current Behavior

Slow update

💁 Possible Solution

onFocus: avoid rerender entire state

onClick: avoid extra process caused by useDragAndDrop hook

🔦 Context

Currently using react-components Tree
React 16

🖥️ Steps to Reproduce

https://codesandbox.io/p/sandbox/6rphml

Version

1.14.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

Sonoma 14.6.1

🧢 Your Company/Team

Ubiquiti

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions