I examine a Compiz performance when it draws desktops using expo plugin. VSync in Compiz and nvidia-settings is enabled. I measure a time this way:
paint()
{
//get time
//all opengl commands
glFlush();
glFinish();
//get time
//calculate paint time
//get time
glXSwapBuffers (mDpy, mOutput);
glFlush();
glFinish();
//get time
//calculate sync/swap time
}
When paint commands take 8 ms, sync/swap time is equal about 7 ms because using glFinish after glXSwapBuffers should blocks when vsync is on. When I run more opengl windows in the expo mode then paint commands take 18 ms and sync/swap time is about 13 ms. How to explain that ? Why glXSwapBuffers is so slow ?
Also when I turn off vsync in nvidia-settings and Compiz and generate drawing commands which take 28 ms then sync/swap time is about 14 ms.