Skip to content
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

Dropdown selector with a long list is very slow #103

Closed
jamestwebber opened this issue Jul 28, 2017 · 15 comments · Fixed by plotly/dash-core-components#47
Closed

Dropdown selector with a long list is very slow #103

jamestwebber opened this issue Jul 28, 2017 · 15 comments · Fixed by plotly/dash-core-components#47
Assignees

Comments

@jamestwebber
Copy link

This might be a plotly issue rather than a Dash issue, I'm not sure.

We've built some dropdown selectors that have very long lists of options (several thousand), and trying to use them is very slow. I couldn't figure out where the options are stored, but I did confirm that it's not going back to the server at least (because I can stop the server and still select a new item).

If there's a way to make the widget more responsive at the expense of memory that would be well worth it for us.

@chriddyp
Copy link
Member

Here's a simple example with 1000 items:

Which seems pretty fast. There might be something else that's going on here that would make it slow. Could you share a simple but slow example?

@jamestwebber
Copy link
Author

"Very slow" might have been a slight exaggeration, but I am impatient (and the users are more impatient). With ~23000 items there's a couple second delay between clicking and getting a list, and there's also a delay between typing and getting any feedback:

dash

@chriddyp
Copy link
Member

chriddyp commented Jul 28, 2017

Ah yeah, different story with 23,000 items. That is slow! It looks like we could maybe swap out the dropdown with https://github.com/bvaughn/react-virtualized-select/ to make it faster....

@chriddyp
Copy link
Member

Just tried out react-virtualized-select on 10k points and it froze 😕

@chriddyp
Copy link
Member

@chriddyp
Copy link
Member

woohoo! now that's what i'm talking about:
fast

@chriddyp
Copy link
Member

OK, published it to a pre-release channel. @jamestwebber - could you try it out?

pip install dash-core-components==0.10.0rc1

@chriddyp
Copy link
Member

It works pretty well for 50k options, but starts to bog down at 100k options

@jamestwebber
Copy link
Author

That sounds like it'll be plenty fast for us, I will give it a shot soon. Thanks for the super fast response!

@jamestwebber
Copy link
Author

Just tried it out, very snappy. 👍

chriddyp added a commit to plotly/dash-core-components that referenced this issue Aug 4, 2017
chriddyp added a commit to plotly/dash-core-components that referenced this issue Aug 4, 2017
chriddyp added a commit to plotly/dash-core-components that referenced this issue Aug 4, 2017
@chriddyp
Copy link
Member

chriddyp commented Aug 4, 2017

Now part of dash-core-components==0.11.0 🍻

@LucaMarconato
Copy link

@chriddyp I have tried using the dropdown in the official example here: https://dash.plotly.com/dash-core-components/dropdown with some thousands of points and the page is very slow at loading (seconds). Is your solution using a different Dash widget?

HammadTheOne pushed a commit to HammadTheOne/dash that referenced this issue May 22, 2021
HammadTheOne pushed a commit to HammadTheOne/dash that referenced this issue May 22, 2021
HammadTheOne pushed a commit to HammadTheOne/dash that referenced this issue May 28, 2021
AnnMarieW pushed a commit to AnnMarieW/dash that referenced this issue Jan 6, 2022
@GitHunter0
Copy link

GitHunter0 commented Jun 16, 2024

Hey @chriddyp , would you be willing to reopen this thread?

There is a javascript plugin virtual-select that solves this issue without the pitfall of only displaying the options available for the user filter, which is the case of the Dynamic Options.

There is an R Shiny extension which employs that plugin and the result is really good: https://dreamrs.github.io/shinyWidgets/reference/virtualSelectInput.html

Thank you

@gvwilson
Copy link
Contributor

Thanks @GitHunter0 - I'll reopen the issue and if you'd like to submit a PR I'll make sure it gets reviewed as quickly as possible - thank you.

@gvwilson gvwilson reopened this Jun 18, 2024
@gvwilson gvwilson self-assigned this Jun 18, 2024
@gvwilson
Copy link
Contributor

Hi - I spoke with one of our developers, and the old dropdowns have been replaced with virtualized ones, which should apply in all cases except dynamic options. If that's your use case, could you please file a fresh issue with a minimal reprex and include @gvwilson in the comment so that it lands in my inbox? thanks - Greg

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 a pull request may close this issue.

5 participants