-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Dash slow pattern-matching performance on many elements #3008
Labels
Comments
5 tasks
Amazing debugging, I had encountered this issue before but never went to the bottom of it. Thanks for doing that! |
Thank you! I'm glad to know that I did not investigate something that only impacts myself. |
gvwilson
changed the title
[BUG] Dash slow pattern-matching performance on many elements
Dash slow pattern-matching performance on many elements
Sep 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
First, thank you for your amazing work on Dash.
Describe your context
Browser: Firefox / Chrome (not related) on MacOS 14 (not related either).
Describe the bug
I recently came across a performance limitation of Dash that really made my app slow, and at some point, unusable.
The idea is that I needed to have N checkboxes that my user can check or uncheck. N can sometimes be 20, but it could actually go up to 500 or 1000. That’s where I hit some performance issue with Dash.
Expected behavior
I expect to have N > 1.000 checkboxes rendered in my webpage with no struggle. A similar Vanilla JavaScript code can handle more than 100.000 checkboxes before the page starts to get slow. I imagine that using React comes with some performance downgrade, but it seems to be optimizable.
Screenshots
Here is a visual example for the problem (for 500) ; you can see a lag between my clicks and checkboxes actually being checked:
Reproducible code
We create 500 checkboxes and get their value with one callback.
The issue is not with the callback itself, but occurs prior to the callback. It just takes some time to gather all the checkboxes, and then fires the callback (which runs fast).
Here are some things I noticed:
Here is the performance report (Firefox). I clicked 4 times, the CPU was around 90% all the time, making the page unresponsive:
One of the bottlenecks seems to be
getReadyCallbacks
from dash_renderer.I hope this can be solved!
The text was updated successfully, but these errors were encountered: