Rendering is slow & flickers on firefox

Hello all

I’m trying to find and fix the root cause of some lags that only happens in firefox

Reproduction steps:
Go to https://tmdojo.com/maps/j3FTAEgaMI5LdO3vzfBcX1feBE3
Load the first replay (doesn’t matter which one)

Close the “Select replays” panel

Click the eye icon to set the cam to “follow” mode on the loaded replay

Click the “Play” button on the footer

On chrome, it’s going smoothly at 144 FPS, no flickering
On FireFox, it’s going at 0.3 x speed, with some flickering

I tried looking at the profiler on both chrome and firefox to try and spot the differences, but they look nothing alike

The code that introduces the lag can be found here

Any idea on what could be the issue?

Regards

FWIW, it runs at full speed for me, no flickering in Firefox/Linux on a crappy Intel GPU.

Interesting
I’m on windows with a NVIDIA GPU

yeah i can replicate, I’m on nvidia too

chrome left , firefox right

Camera movement is smooth, but the vehicle movement is stuttering.

Looks like some sort of precision issue , are you using performance.now() or date.now() ?

also try using Timer from three/addons instead of THREE.clock