plotly / dash

Data Apps & Dashboards for Python. No JavaScript Required.
https://plotly.com/dash
MIT License
20.95k stars 2.02k forks source link

[BUG] Dropdown takes too much time to render #2251

Closed daviddavo closed 1 day ago

daviddavo commented 1 year ago

Describe your context Please provide us your environment, so we can easily reproduce the issue.

The problem appears since dash 2.6, it didn't exist in 2.5

Describe the bug

I have a Dropdown with about 1000 items. Because it uses 'react-virtualized-select', I didn't have any problems with it.

Nevertheless, a problem appeared with the 2.6 version, where the dropdown takes a lot of time to appear on the page (even if the HTML is there). According to the "Performance" tab, this is because react is trying to "sort" something, of the 4 seconds of the render task, most of them are on the UnorderedSearch.js.

Also, if you do a keystroke on the dropdown, it takes about a second to process, making the UX very clunky.

Expected behavior

For the dropdown to appear swiftly and the keystrokes to be responsive

Screenshots

image Screenshot of the Profiled application, showing the long, 3 second task

Previous research and other information

This problem appears on dash 2.6. I also tried creating a custom component using the ReactDropdown from 'react-virtualized-select', and there are no problems.

daviddavo commented 1 year ago

https://github.com/plotly/dash/compare/0c42b70dd80dee1e3c4b807bea210a493fa85bd3..1bc06cfb5b63734c94890e61082444c8d367e02d

Comparing those two versions, I think the culprit is the new indexes, but I'm not sure

gvwilson commented 1 day ago

Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are most important to our community. If this issue is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. (Please note that we will give priority to reports that include a short reproducible example.) If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson