Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by SUpersindit2 · Jun 26, 2015 at 01:55 AM · cpu usage

VSync Decreases Performances?

This is the situation,when I am running my game with Fantastic quality setting and making the V Sync Count Every V blank,the game seem to run fine,I changed it to Every second V Blank,The game all of sudden seem to run slow, Then I changed it to no Vsync at all then the game ran very fast.I Checked the profiler and found out that VSync Is taking up the majority of the CPU Usuage.I want to know how VSync works and what they do.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
38
Best Answer

Answer by Dave-Carlile · Jun 26, 2015 at 02:07 AM

Vertical Sync synchronizes the frame display with the monitor refresh rate. This prevents the "tearing" effect that happens when the game updates a frame in the middle of a screen refresh, and generally makes things run more smoothly.

Syncing isn't hurting your performance. You aren't using up the entire time you have available to build the next frame, so your code ends, and then Unity waits for the vertical sync to display it.

Think of it like this. Frank and Bob are both working on something, but once every minute they have to push a red button. Neither can continue doing their job until both have pressed the red button each minute. Frank always finishes his task in 20 seconds and pushes the red button. But Bob always takes the full minute to do his work before pressing the red button.

So each minute, Frank has to wait 40 seconds, idling, doing nothing, until Bob presses the button. Then they both continue on.

Frank is the CPU, Bob is the GPU/V Sync. The CPU gets its work done for the frame and is ready to go, but it must wait for the GPU to "push the red button" before it can continue on and start working on the next frame.

Comment
Add comment · Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SUpersindit2 · Jun 26, 2015 at 02:30 AM 0
Share

The CPU Usuage of the vSync is taking up alot of the usuage how can I reduce it?

avatar image DoubleIsLoveDoubleIsLife · Jun 26, 2015 at 06:51 AM 1
Share

You don't, or you turn off vsync. The reason it 'uses' lots of CPU is because the cpu has to wait for the GPU.

avatar image Dave-Carlile · Jun 26, 2015 at 12:20 PM 9
Share

Exactly - that CPU is still available to your game if you add more functionality that requires it, in which case Unity won't have to wait as long for the vertical sync.

Think of it like this. Frank and Bob are both working on something, but once every $$anonymous$$ute they have to push a red button. Neither can continue doing their job until both have pressed the red button each $$anonymous$$ute. Frank always finishes his task in 20 seconds and pushes the red button. But Bob always takes the full $$anonymous$$ute to do his work before pressing the red button.

So each $$anonymous$$ute, Frank has to wait 40 seconds, idling, doing nothing, until Bob presses the button. Then they both continue on.

Frank is the CPU, Bob is the GPU/V Sync. The CPU gets its work done for the frame and is ready to go, but it must wait for the GPU to "push the red button" before it can continue on and start working on the next frame.

avatar image Wolfdog · Jun 26, 2015 at 05:40 PM 0
Share

+1 - excellent.

PS: you should add your comment to the answer. It's the best explenation I've read in a long time.

avatar image mattis89 · Nov 22, 2017 at 07:29 PM 0
Share

So of the cpu have to wait for the gpu..does it mean that my gpu sucks? I have the same issue.. no v sync 500 fps.. with v sync 80.. every second 30 fps.

avatar image nahuel93 mattis89 · May 29, 2018 at 03:37 PM 0
Share

Not necessarily, it's your monitor the one that refreshes. If your monitor's refresh rate is 60Hz, then if your game would run at more than 60 fps (say, 85 fps) you would have to wait for your monitor, not the gpu

Show more comments
avatar image
2

Answer by MisterKidX · Jan 01, 2019 at 08:25 AM

Just wanted to shed more light on this matter, concerning the profiler.

When Quality Settings > V Sync Count is set to an option that is not "Don't Sync" (Or by code, see reference) Unity will match frame rate to your monitors' refresh rate (depending on the value you have given Vsync). What you see in the profiler under CPU Usage > Vsync is the time unity waits before rendering another frame. This can be foundin the hierarchy view of the profiler as Initialization.PlayerUpdateTime > WaitForTargetFPS. What this means, basically, that this value is actually positive as it grows larger in percentage.

Note that you will not see valid value if the option of Vsync is turned off from the Quality Settings menu.

https://docs.unity3d.com/Manual/ProfilerWindow.html https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ccreng · Apr 18, 2021 at 08:42 AM 0
Share

Thanks for your help, I turned off vsync, then I used Application.targetFrameRate to limit the fps.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

26 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Saving the Overview part of the profiler 0 Answers

Why does my CPU-heavy A/I run so slow in Unity? 1 Answer

Unity app consuming CPU resources in sleep mode on Android? 0 Answers

Reduce CPU usage of Headless mode 1 Answer

Shortcuts to saving CPU and GPU? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges