Is it normal to see occasional (once-every-few-seconds) dips in framerate to anywhere about 0~30 FPS? (normal is 60 FPS) Logging app.ticker.FPS
, I see dips every so often that only last for like one frame and have no visible effect on the actual smoothness of the game (but I multiply everything out by delta so that might be why I can't notice the lag spikes).
pixi.js
version: v5.0.0-rc.2Not sure if this is the case here but usually these types of dips are because of garbage collection. If you are creating and destroying objects over and over it will require these unsightly hiccups. The common way to mitigate is to pool the objects and recycle them instead of creating a new one and throwing it away. Here鈥檚 some info on that: https://www.html5rocks.com/en/tutorials/speed/static-mem-pools/
Thank you, I did some GC optimization (I was creating a new function every update call, uwu) and the lag spike seems to be gone (at least for the most part)! For any future viewers, http://buildnewgames.com/garbage-collector-friendly-code/ this article also helped out a lot.
Closing this now :)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Not sure if this is the case here but usually these types of dips are because of garbage collection. If you are creating and destroying objects over and over it will require these unsightly hiccups. The common way to mitigate is to pool the objects and recycle them instead of creating a new one and throwing it away. Here鈥檚 some info on that: https://www.html5rocks.com/en/tutorials/speed/static-mem-pools/