2.7. Identifying problems in applications

If you suspect that there is a performance bottleneck at a certain point in your application, you can apply optimizations at that point. If throughput increases, then it is possible that you have correctly identified the problem. However, identifying and correcting one bottleneck might expose other bottlenecks elsewhere in the application.

In general, finding bottlenecks can be difficult. In addition to using profiling tools such as the Performance Analysis Tool, the usual approach is to increase or decrease the load on individual graphics pipeline stages, to observe the effect on performance.

Note

With multi-pass rendering, bottlenecks can be different in each pass. Be aware of this when identifying and reducing bottlenecks.

Table 2.2 contains suggested actions you can take to resolve problems in the various pipeline stages. Use these techniques to identify and reduce bottlenecks.

Table 2.2. Application problems and suggested solutions

For problems with...Try the following approach:
Application codeReduce the amount of processing that is unrelated to OpenGL ES calls, such as input processing, game logic, collision detection, and audio processing.
  
Driver overheadGroup geometry with similar state together and eliminate unnecessary state changes.
Vertex attribute transferUse smaller data types for the values. Also, use a more economical triangle scheme, and in general use glDrawElements rather than glDrawArrays.
Vertex shader processing, or Transform and Lighting in OpenGL ES 1.1

Try the following options:

  • Use glDrawElements rather than glDrawArrays.

  • For OpenGL ES 1.1, reduce the number of lights.

  • Minimize the transformations of texture coordinates. You can avoid these transformations by setting the transformation matrix using OpenGL ES 1.1 function glLoadIdentity.

  • For OpenGL ES 2.0, simplify the vertex shader program.

Polygon list buildingUse fewer graphics primitives. Also, avoid drawing significant amounts of the total geometry in any single call to glDrawElements.
Varying data transferIn OpenGL ES 1.1, use fewer texture coordinates. In OpenGL ES 2.0, use fewer varyings, and specify lower precision on varying variables out of the vertex shader.
Fragment shader processing, texture, color sum, and fog in OpenGL ES 1.1

Lower the resolution of the render target or reduce the size of the viewport.

For OpenGL ES 1.1, use fewer texture stages.

For OpenGL ES 2.0, simplify the fragment shader program.

Texture bandwidth

Try the following options:

  • use fewer texture stages

  • lower the size of the textures, by using a smaller data format for each pixel, lower resolution, or texture compression

  • use a simpler texture filtering mode

  • collapse texture coordinates so that they always read from the same position in the texture.

Transfer to display framebuffer

Try the following options:

  • use a mode with lower pixel precision

  • lower the resolution of the render target.


Copyright © 2007-2009 ARM. All rights reserved.ARM DUI 0363D
Non-Confidential