Is there anything that could cause a steady and consistent FPS drop in a three.js app?
The FPS in my three.js game, starts to dip at about 2 minutes in and goes down steady and slow until it reaches 0 (after about 30 minutes).
I first suspected a memory leak but chrome heap snapshots dont seem to be getting much bigger over time (see screenshot).
Is there anything else that could cause a steady consistent FPS drop like this?
Happy to share a live link privately if anyone wants to see the full code
Try measuring app performance using the Performance
tab in devtools. If it’s caused by JavaScript - it’ll tell you exactly what’s taking so much time.
Thanks @mjurczyk ! I’ve just tried this and it seems that heapsize and nodes are climbing steadily.
Where would I go from here?
turns out the problem was the three.js audio engine, I switched to howler.js for audio and the FPS stabilized.
more about this issue here:
Has anyone here noticed an issue with AudioListener eventually dominating the performance graph after running for long periods? I have an app with an AudioListener, and after leaving it running for 6 hours, it gradually slows down… if I then pause it and .remove the audioListener from the scene… fps suddenly goes back up to 60
[image]
notice the “linearRampToValueAtTime” is dominating the frame…
That method is used inside three to interpolate audio listener parameters, Inside updateMatrixWor…
2 Likes