theatre
theatre copied to clipboard
Many event listeners created by theatre/studio, possible memory leak
We've been noticing that while scrubbing the sequence position, theatre/studio appears to create a lot (thousands?) of listeners, and the JS Heap climbs pretty fast as well. These eventually do get cleaned up, but it seems like a possible performance bottleneck that we weren't seeing before the v0.5.x prereleases. We encountered this in our own project but it's easily reproducible by scrubbing the sequence time in a playground link as well. In the screenshot below, each area where the graph is climbing corresponds to when I was scrubbing the sequence. I see the same issue when driving the sequence by scrolling in our application, but I don't see the issue if theatre/studio is not hooked up:

Thanks @donmccurdy! This is a pretty urgent issue. It'll be fixed in the next release!
Hey @donmccurdy, to confirm, was this issue fixed in 0.5?
Visiting https://theatre-playground-theatrejs.vercel.app/shared/r3f-rocket and scrubbing the timeline, you'll still see a lot of this memory allocation:

That said, I'm not seeing user- or developer-facing performance issues to suggest that these allocations are causing any actual problems. If it's just a hypothetical problem during editing, and doesn't affect runtime use at all, then we probably don't need to keep this issue open. Thanks!