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.
A program is free to do non-graphics computation during the wait cycle between vertical retraces. Therefore, the procedure for rendering a frame is: call swap buffers 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 takes 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.