Profiler says that graphics.clear spikes at 8-12ms

Have weird stuttering on ios mobile. When profiling it, on different frames different spikes are occuring but the weirdest one is that graphics.clear are spiking 1-2 times in a 20 frames capture.


(yes I need to do something about those draw calls…
)
Another thing is that on ios (only) messaging spikes now and then on 15-20 ms(!!!) Yes, it could be in conjunction of server-state being sent to client but such horrible time? Feels like something is fishy. but hey… lets start with the graphics.clear thing.

2 Likes

That is fishy indeed… is this in debug och release mode?

EDIT
D’oh debug of course since the web profiler is available

CPU and GPU run in parallel, so measuring time of individual GL calls usually has no meaning.
Most GL calls just set some state of the GPU or write to a command buffer, the command execution happens asynchronously. What happens here seems close to something called a “performance cliff”, which can happen when a lot of submits are done to the command buffer before a swap takes place.

Anyway, for OpenGL ES we should definitely use the glDiscardFramebufferEXT (EXT_discard_framebuffer) which we are for iOS, but not for Android. We have a ticket for this and I think it’s something we need to prioritise.

More investigation on your particular scenario would be appreciated. Is there any way you can provide STR or an example project?

Sry to hear that you’re sick but hey, thanks for the clarification. I am deep into looking for reasons for the script spikes as well and now unfortunately it seems like we still have a problem with collection factories.
Some very simple collections (one gameobject with one particlefx and one script for starting it) takes 13 ms (or more) to create (measuring socket time before and after collection_factory.create). Not every single time but frequently.

This is happening both on mobile and desktop.

I will try to find a way to provide an example.