294 CHAPTER 9: Performance ’n’ Stuff^
Figure 9-1. Giant computer-generated sow bug. Or 11 planet earths stacked on top of each other.
When it comes to testing the frame rate in examples like this, Apple has supplied an
incredibly simple but powerful new tool with the iOS 5 dev install. Called OpenGL ES
Performance Detective, as shown in Figure 9-2, it can link up to any of your apps on
your device and give you the frame rate. If the rate is slow, it will analyze it for you and
let you know whether it is an OpenGL issue and, if so, will recommend possible
solutions.
Using this tool, it told me that on my iPad 2 the example was running about 9.5 frames
per second (FPS) when not using VBOs but jumped almost 50 percent to 13.5 FPS.
Interestingly enough, there was virtually no detectable increase on my iPad 1, which
hovered at only about 2.5 FPS, while on both an iPhone 3GS and iPhone 4, the VBO
frame rate was just slightly less than when not using VBOs (2.0 vs. 2.3). The
Performance Detective is telling me that the frame rate is the performance bottleneck,
while suggesting that I limit the data.
Note All of the devices, from the iPhone 3GS to the iPad 1, use the same GPU from
Imagination Technologies, the PowerVR SGX-535, while the iPad 2 uses the dual-core SGX
545MP. So if your app’s limitation is OpenGL related, it would likely run about the same on any
machine that uses the same GPUs.
All of these tests are relative to each other, because the example is fully contrived and
may not reflect your own situation.