Android Performance Optimization Series--vsync

Source: Internet
Author: User

Concept
    1. Vsync,vertical Synchronization
    2. Refresh Rate Screen A second number of refreshes, determined by the hardware, unit Hz, typically 60Hz
    3. Frame rate GPU Draws the number of frames in one second, unit fps (Frames per second)
Specific explanations

The GPU obtains the graphics data to draw, the hardware will draw the good data to present on the screen, in order to make the picture on the screen smooth display, needs to maintain frame rate above 60, namely the time draw operation not more than 16.7ms.
Frame rate does not always coincide with Refrash rate, and truncation occurs if the GPU draws faster than the screen refresh, because the GPU uses a piece of memory to draw frame data, and the new image frame overwrites the old image frame from the top to the next line. When the screen refreshes, the current data state of the buffer is not known, which captures a frame of data that has not yet been drawn in the GPU.

The workaround is a double-buffering technique (double buffering), where the GPU first writes the frame data to the back buffer and then copies it to another area of frame buffer. When the next frame is drawn, the data is first written to the back buffer, and the screen is refreshed only from frame buffer. If the GPU is writing back buffer and the screen is refreshed, VSYNC will block the copy process.

VSYNC or vertical Synchronization,will basically keep this copy operation from the back buffer to the frame buffer from happening If the middle of refreshing from it.

When the GPU is drawing slower than the screen refresh rate, that is framerate < RefreshRate, you will see a lag on the screen. So try to make sure that the drawing time of a frame is less than 16ms.

Reference

Android Performance Patterns:understanding VSYNC

Android Performance Optimization Series--vsync

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.