I’m using Dash to build a rather large form that has has a callback with around 1600 States. I know this is not exactly what Dash was designed for, but that I can use Dash to build these forms in Python is pretty compelling.
Everything is working fine except that the request to ‘_dash-update-component’ for my callback is taking around 9 seconds. I tried profiling the Flask app using the WerkZeug middleware profiler (eg app.server.wsgi_app = ProfilerMiddleware(app.server.wsgi_app)) and couldn’t see anything pathological going on. There was actually some improvements to the dispatch function in dash.py I could make to speed things up (creating a dictionary of state objects in order to link them to the relevant component_registration rather than scanning the list repeatedly) however this only took the time in dispatch down from around 0.6 seconds to around 0.1 seconds.
The whole request is only taking around 0.2 seconds according to the profiler. And furthermore, I’m not returning a large payload, just some text. Oh and it seems to be only an issue when the callback fires on the initial page load. Subsequent requests for this callback are a reasonable time.
So I’m wondering where the 9 seconds might be coming from?