VSync causes really bad performance

So I’m making a game for an Android but I’m stuck because of it’s really low performance. In the profiler I see that VSync caps the game to run on 60 fps (that’s fine) but when I pick a level and start playing it, the fps drops down to 30 fps, sometimes even lower. When I turned off VSync in the profiler, the fps went from 30 to 200. Every object and piece of code is optimized. The only thing that causes problems is VSync and since I can’t disable it on Android I want to know if there’s a way to have constantly 60 fps.

You probably still need to optimise draw-calls so that the device can handle the fill-rate that you are requesting.

Did you try running it at a lower resolution? 50 percent or even lower, if this increases the fps to steady 60 you may be fill-rate limited.

Wow, you are right. I didn’t think that would solve the issue, thanks!

Yep, mobile hardware enforces vSync. Mobile phones can also lower the clock speeds of CPU or GPU if the energy budget is exceeded (besides pure computing power, Mobile data usage, high amount of Random RAM vs L* Cache access, GC.Alloc, Disk Access, Screen brightness … all take their bite out of that shared and rather limit budget) or if the phone starts overheating. So if you are seeing a gradual drop in performance or varying speeds over the same general workload, chances are you need to get a bit more aggressive on optimizing than just getting your frame time under 16.6

However, you could also just have oscillating timing issues in your rendering pipeline where work is handed from Main Thread to Render thread to GPU and then the next Main Thread frame might have to wait for he GPU to be done, which can only be done on a vBlank (I.e every 16.66ms) so if you missed it by just a bit, you might have to wait for the next vBlank and then execute more FixedUpdates (or maybe something else entirely is now happening later in the frame ) which then causes the next frame to be delayed… you need to look at this via the CPU Profiler’s Timeline view to make any sense of it.

Also, in your player settings you can also turn on Optimized Frame Pacing for a smoother result.

1 Like