You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RTT is already quite resource intensive and unhappy in a single thread. Ideally it would use a Web Worker for state updates and rendering, but not many browsers support writing to a canvas from a Web Worker (and passing data from a Web Worker to the main thread is surprisingly slow when trying to do 30-60fps.)
So instead I should look at where CPU cycles are going. Maybe I won't fix it but it would be great to have data on what is expensive and what is cheap.
The text was updated successfully, but these errors were encountered:
I've been getting frustrated by the jittery, difficult performance
that RTT has shown recently. I already did some profiling in the
`profile-performance` branch to start tracking it down, and that led
to a major pathfinding improvement. This is all part of #13.
To help track things down I added the THREE.js Stats visualiser [1].
To my complete surprise, I was not using `requestAnimationFrame` to
schedule updates. Instead I was using `setTimeout` and aiming for
30fps.
I think I found strange `requestAnimationFrame` behaviour when frames
regularly took a long time to compute, but that is no longer the case.
Switching back to `requestAnimationFrame` shows an enormous
improvement in game experience! :)
[1] https://www.npmjs.com/package/stats-js
RTT is already quite resource intensive and unhappy in a single thread. Ideally it would use a Web Worker for state updates and rendering, but not many browsers support writing to a canvas from a Web Worker (and passing data from a Web Worker to the main thread is surprisingly slow when trying to do 30-60fps.)
So instead I should look at where CPU cycles are going. Maybe I won't fix it but it would be great to have data on what is expensive and what is cheap.
The text was updated successfully, but these errors were encountered: