As a webGL developer, those graphs leaves me heartbroken. There's no way a smooth animation could play uninterrupted if the garbage collector runs in the main thread blocking for more than half a second the animation's workflow
I've tried it all, caching, object pools, declaring global variables and making my returning functions work like a state-machine until I finally found that even the empty call to RequestAnimationFrame itself could produce up to 1mb of garbage every second
Ping-pong calls to RAF doesn't change garbage creations rate on my system either
Assuming there's no possibility to have a fully responsive webgl page when GC kicks in, i'd like to know if there's any alternative to the usual code structure that we generally see in a webgl project. At first I thought to use a webWorker and leave the main thread free to GC without interrupting the animation rendering at the expense of delving into the OffscreenCanvas interface but it appears that it's only supported in Firefox atm
Using setTimeout should still create jitter and is rightfully considered bad practice so I wonder if there's really a workaround to avoid GC interruptions

