mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
3.92k stars 1.19k forks source link

[TreeView] Performance issue on TreeView with large data set #10300

Open satyajitrout58 opened 10 months ago

satyajitrout58 commented 10 months ago

Duplicates

Latest version

Steps to reproduce 🕹

Link to live example: https://stackblitz.com/edit/react-eywhbq-ldiizc?file=Demo.tsx,index.tsx

Steps:

  1. Collapse tree items which all have subitems inside them. It takes some time to display.
  2. Click on the Add Item button to add a new item to the existing tree items.
  3. When we have more than 5,000 tree items if we collapse or add any item stack overflow and page unresponsive error is coming.

Current behavior 😯

  1. When we have more than 1000 items there is a delay while collapsing tree items.
  2. When we have more than 5,000 tree items if we collapse or add any item stack overflow and page unresponsive error is coming.

Expected behavior 🤔

  1. All the operations should be faster when we have more than 1000 tree items

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo ``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```

Order ID or Support key 💳 (optional)

No response

noraleonte commented 10 months ago

Hey @satyajitrout58 👋

Thanks for opening up this issue being interested in the TreeView 🤙

Right now the component is not particularly optimized for supporting large datasets, but performance optimization in this sense is one of our main priorities for the upcoming months as we are redirecting more effort towards developing the TreeView. I renamed and labeled the issue accordingly, and we will update you here once we have an improvement.