1
\$\begingroup\$

I'm trying to profile the game using Unity Profiler in order to catch any potential performance issues. The graphics settings support VSync feature.

However, I am not sure which one is the best practice to have a better profiling insight, having VSync on or off?

\$\endgroup\$
  • \$\begingroup\$ I think you shouldn't care about this feature because in many games player can turn on/off this feature (QualitySettings.vSyncCount = 0;).A profiling tool gives detailed information about how our game is performing. If our game has problems, such as low framerate or high memory usage, a profiling tool can show us what is causing these problems and help us fix them.so what you should do is balancing framerate or memory usage and try to find problems.VSync Decreases Performances? \$\endgroup\$ – Seyed Morteza Kamali Oct 26 '18 at 8:19
  • \$\begingroup\$ @SeyedMortezaKamali that looks like an answer to me. :) \$\endgroup\$ – DMGregory Oct 26 '18 at 23:49
  • \$\begingroup\$ @SeyedMortezaKamali Yea, but the question is do we need to have the VSync enable while profiling? because it might not give us the outcome benchmark we are looking for, and it's not accurate to find the exact spots that cause the performance problems. \$\endgroup\$ – Emad Oct 28 '18 at 22:30
1
\$\begingroup\$

So based on the Unity Diagnosing Performance article disabling the VSync seems like a good practice while profiling the game.

Rule out VSync

Vertical Synchronization, known as VSync, is used to match a game’s frame rate to the refresh rate of the screen it is being displayed on. VSync can affect the frame rate of our game and its effects can show in the Profiler window. If we are not sure what we’re looking at, it can look like a performance problem, so before we go any further we need to learn how to rule VSync out of our investigations.

Hiding VSync information in the CPU usage profiler

We can choose to hide information in the CPU usage profiler graph. This allows us to ignore information that is not useful to our current investigations.

To hide VSync information from the CPU usage profiler graph, follow these steps:

Click on the CPU usage profiler to select it.

In the top part of the Profiler window, where the CPU usage profiler shows its data over time, click the yellow colored square labelled VSync to hide VSync information from the graph.

Disregarding VSync information in the Hierarchy view

There is no way of hiding VSync information from the CPU usage profiler’s Hierarchy view, but we can learn what it looks so that we can disregard it.

Whenever we see a function called WaitForTargetFPS in the Hierarchy view, this means that our game is waiting for VSync. We do not need to investigate this function and can safely ignore it.

Disabling VSync

VSync cannot be disabled on all platforms: many (such as iOS) enforce its use. However, if we are developing for a platform that does not enforce VSync we can disable it altogether in our project while we profile. To disable VSync, open the Quality Settings inspector by going to the top menu bar and selecting Edit **> **Project Settings > Quality. From the drop-down menu labelled VSync Count, select Don’t Sync.

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.