306 CHAPTER 9: Performance ’n’ Stuff^
Trace: Shows every OpenGL call made and supplies a call stack in the
detail pane on the right.
Call Tree: Aggregates the stack traces so it can display them as call
trees by queue.
Api Statistics: Shows cumulative usage metrics not covered
elsewhere. Fields covered for each OpenGL API call include number of
times it’s been called, total time in each call in microseconds, and
average time (also in microseconds). My app is showing that over a
period of five minutes, glDrawArrays() have been called 3,369 times,
with an average time of 67,174 μsecs. PresentFrameBuffer() in the
EAGLContext has only 306 calls, but a whopping amount of time, with
the average time of 83,561,776 μsecs.
Summary
In this chapter, you learned about the basic tricks and best practices to make your
OpenGL app really perform. Vertex buffer objects will cut down saturation of the bus by
keeping commonly used geometry on the GPU. Reducing the state changing and glGet*
calls to a minimum can also yield a substantial improvement in rendering speed.
After that, you learned a little about the OpenGL ES analyzer that is new in the Xcode 4
release of Instruments; it acts a little like an MRI machine for your code, making visible
that which was once hidden.
In the final chapter, you’ll learn a little about OpenGL ES 2.0 and those mysterious
shader things that are all the rage these days.