I’m using request animation frame to tween an objects position. just going in a linear fashion from a to b. It looks decent enough, however sometimes seems to “stutter” and according to chrome dev tools I get dropped frame(s)
when I look at the performance report I generally get this…
In general, it’s hard to evaluate performance issues without seeing the code. Even then it’s problematic if the application is quite complex. It’s preferable to reproduce performance issues in small-scaled examples.
Anyway, frame drops in WebGL can be cause by many issues. For example you should ensure to avoid object creation wherever you can. Otherwise the GC overhead will be more noticeable and perform larger frame times. Also subtle things like outdated graphics drivers can cause such performance issues.
I suggest you remove as much code as possible from your app and simplify it until the performance issue goes away. This is often the only way to narrow down a performance issue if you have no clue at all at the beginning.
I’ve experienced that the visualizations of the performance tab are sometimes misleading. If you can ensure that you don’t call render() twice within a single frame, you can ignore this issue.
If its of any interest to others, I believe I have tracked the issue down, as @Mugen87 suggested, to the GC. I was copying a lot of objects, which could fill it and this caused the GC to fill and need emptying.
I also found that using the memory tab on the chrome dev tools really helped (id somehow never actually used it!) as well as making sure memory is ticked on when recording performance, I could tally up the drop in memory.
thanks to @Mugen87 for pointing me in the right direction