High cpu usage when typing in text fields with plotly graphs on screen

I’m seeing very high cpu usage for keystrokes in text fields just when plotly graphs are on screen in a web browser. I had originally opened this as an issue on streamlit, because using plotly with it on my older computer, the input lag when typing was so bad it was unusable to type, I had to switch to Altair graphs.

On my M1 Mac Mini, the problem is less noticeable: though the CPU usage still is very high compared to say an Altair graph. Those CPU charts are on the streamlit issue link above. I had thought maybe it was a javascript interaction on their end.

But, moving to Dash/plotly instead of streamlit, and CPU usage seem inordinately high when I’m just typing text in a window, unrelated to the graph and in a Dash app without any callbacks. (The CPU usage in fact is high even with the server dead so the only thing happening is local javascript.) Here is a screen shot of CPU usage from Safari when running this super simple Dash app (again, no callbacks, just puts 5 graphs on the screen) and the CPU usage is just from me typing in the dcc.TextArea above it (again no callback is watching that Input)

This is all manageable on a fast modern multi-core computer but my circa 2015 Intel Macbook, the text lag is unbearable. Is this a known issue? Should I open an issue against plotly.js? I wasn’t sure what to do with this.

Hello @marcosh,

I saw your post about a bug here: [BUG] High CPU usage when typing in text field and plotly graphs on screen · Issue #2297 · plotly/dash · GitHub

I think this may be due to how react works, all events will get parsed to see if there is anything attached to trigger a react element update. Not sure if there really is a way around this.