Editor Update: Mobile Performance Degradation

Hello, this thread is about mobile build performance degradation caused by Unity Editor update.

Introduction
I got an Android project that has been abandoned by me quite a long time ago, it was made in Unity 5.6.3.

Recently I decided to work on it again, so I had to download recent Unity 2021.1.15 and update the existing project. I switched to URP and decided to test the game on real device several days after that, I expected to get around 40 FPS on High Settings, but instead I got 23 FPS. Doing “Application.targetFrameRate = 60;” trick didn’t imrove the situation.

After doing some research I came to the conclusion the problem should be related to graphics complexity as Profiler shows Gfx.WaitForPresentOnGfxThread / Sempahore.WaitForSignal takes a lot of time. Indeed, almost every object in the game was using custom URP Shader Graphs, so I switched back to Built-In Pipeline and started using my old custom handwritten shaders and… It didn’t improve anything at all, I tried to use some things as Multithreaded Rendering, Optimized Frame Pacing, optimizing LODs distance, camera view distance, etc. but it didn’t bring the performance I expected, so I decided to make tests to determine whether Unity Editor update made situation worse or not.

Tests
I attached file with tests, the most reliable one is the Test 3 because all Project Settings are basically the same between projects and Performance is measured as a count of frames rendered in first 100 seconds of the game running, instead of me estimating average of Average FPS.

Original Project: Updated from Unity 5.6.3 to Unity 5.6.7 (Minor Update)
Updated Project: Updated from Unity 5.6.3 to Unity 2021.1.15 (Major Update)
New Project: Unity 2021.1.15 Blank Project where all the assets were either Drag & Dropped or Imported as a Package from “Updated Project”

Tests were performed in the following order: Updated Project - New Project - Original Project, so if there is any throttling it will affect Original Project, not the updated ones.

Assumptions and Notes

  • Frametime in Unity 2021.1 Build is always synced with the screen refresh rate (16.6, 33.3, 50.0 ms. or 1/60, 2/60, 3/60 s. in my case) for some reason, so performance difference between Original and New Project may be explained by this factor.
  • There is definitely a performance drop in Updated Project. Why? I don’t know.

Questions

  • Why is frametime always synced with the screen refresh rate and how can I disable it?
  • Why does updating the project make Performance worse?

7432418–910277–Unity Update Performance Degradation.pdf (127 KB)

@Tautvydas-Zilys I’m sorry to CC you again!

However, in my defence, this is probably something you can explain better than anyone else. I hope you’ve got a few moments to do so, or point to something that helps with the above.

Sorry to bother you, again.

We changed how Time.deltaTime calculations work to reflect reality: the display can only display your frames at those intervals, and to achieve smooth movement, that’s the deltaTime you need to use to calculate how much time passed since the last frame. You cannot disable this behaviour, but it is very unlikely that’s the source of your issue.

I don’t have a straightforward answer to that, but “Gfx.WaitForPresentOnGfxThread / Sempahore.WaitForSignal” taking a lot of time points to a GPU bottleneck. Perhaps graphics settings are now configured higher, or you’re rendering at higher resolution. Or maybe there’s something entirely unrelated to it. I’d recommend using a GPU profiler but I have no idea what they look like on mobile as I’m not familiar with mobile development.