I use the same callback in my application in multiple places. To be precise, I register the same Python function multiple times using callback
with different Input
s and Output
s. In some places, the callback is very responsive. In other places, there is a significant delay between an Input
property change on the client (i.e. I type in an input field) and the execution of the callback on the server (i.e. the execution of a print call at the beginning of my Python function). I would like to avoid this delay. Through extensive testing, I can rule out all the following possible causes:
- Pattern matching: The callbacks do not use pattern matching.
- Debounce: The inputs do not use debounce properties, and the delay is not consistent.
- Data transfer: The
Input
s andOutput
s are not very large (at most 50 single-word strings). More importantly, the callback is significantly delayed on one page in a low-data use case, but perfectly responsive on another page in a large-data use case. - DOM updates: The delay is between an input change on the client and the execution of the callback function on the server, not between the execution of the function and the changes on the client.
- Slow Python code: Using the
time
module, I can confirm that the execution time of the Python function is negligible. - Network latency: All of this is happening in my local development environment.
I have the suspicion that Dash introduces the delay by not reacting properly to changes in my Input
s. I do not share my code here, because I can not reproduce the delay with a minimal example, and I can not share the corporate application. I am not asking for code suggestions. Instead, I would like to know how I could confirm or refute my suspicion using Python, Dash, or Firefox developer tools? Or alternatively, if there are any possible causes of delay that I might have overlooked?