The most important aid for optimizing frame rate performance is taking timing measurements in single-buffer mode only. For more detailed information, see ``Taking Timing Measurements.''
In addition, follow these guidelines to optimize frame rate performance:
This is the only way to produce an observable performance increase.
If an implementation allows control to return to a program while waiting to swap the color buffers, the program is free to do non-graphics computation. Therefore, the procedure for rendering a frame could be: call swapbuffers immediately after sending the last graphics call for the current frame, perform computation needed for the next frame, then execute OpenGL calls for the next frame.
Clearing a full screen can take time. If you make additional drawing calls immediately after a screen clear, you may fill up the graphics pipeline and force the program to stall. Instead, do some non-drawing work after the clear.
If you are rotating or otherwise moving an object at a fixed speed, it is wise to base the transformation on the amount of time spent rendering the frame rather than a fixed amount per frame, so that the motion does not speed up or slow down as scene complexity or viewing angle changes.