High CPU Usage Due to Desmos Event Binding

48 views
Skip to first unread message

Divyesh Shah

unread,
Aug 29, 2025, 9:36:25 AMAug 29
to desmos-api-discuss

Hi,

We have integrated Desmos into our application, but we are noticing an issue. When Desmos is loaded, it binds multiple event listeners to the document. Even after we are done using Desmos, those event listeners remain active and continue firing, which results in constant CPU spikes.

Is there a recommended way to properly clean up or unbind these events once Desmos is no longer needed? Any workaround or best practice would be greatly appreciated.

Thank you in advance for your support.

Chris Lusto

unread,
Aug 29, 2025, 9:42:51 AMAug 29
to desmos-api-discuss
We provide a destructor to clean up resources from calculator instances that you want to remove from the DOM. You would simply call the instance's `.destroy()` method.

Divyesh Shah

unread,
Aug 29, 2025, 9:52:52 AMAug 29
to desmos-api-discuss

Hi, thank you for your response. We are already destroying the instance, but we noticed that the calculator js still binds events to the document. These event listeners remain active even after destroy, which continues to impact performance.

I’ve also shared the specific function that is causing the performance issue for your reference.


  
desmos.png

Chris Lusto

unread,
Aug 29, 2025, 10:49:49 AMAug 29
to desmos-api-discuss
Great, thanks! If there are still listeners not getting cleaned up by `.destroy()`, then that sounds like a bug. We can take a look.
Reply all
Reply to author
Forward
0 new messages