Performance Starting Point for iOS

When writing software for iOS, optimizing code to minimize use of the processors and memory is crucial to the performance of your application and therefore to a good user experience.

image: Art/Templates.jpg

Contents:

Get Up and Running

The main tool for analyzing your code’s use of the CPU, GPU, and memory is the Instruments application. Although you can do some optimization of your code using Simulator, you need to run your application on a physical device in order to determine how efficiently the CPU and GPU are being used. To learn how to set up your device for use with Instruments, see “Tuning Applications” in iOS Development Guide.

Each of the tools in Instruments is documented in Instruments User Guide.

Become Proficient

For a discussion of performance tuning for iOS, as well as a great deal of other information on programming for iOS, see iOS App Programming Guide.

Although written specifically for the Mac OS X operating system, the general principles discussed in Performance Overview apply to iOS as well.

For details on management of memory resources, see Memory Usage Performance Guidelines.

Optimize Your OpenGL ES Graphics Code

iOS has several frameworks for graphics and animation. The highest-performance graphics are provided by OpenGL ES, which communicates directly with the GPU. OpenGL ES is typically used by games and other applications that require complex graphics that must be rendered very quickly. If you are using OpenGL ES, see “Performance Guidelines” in OpenGL ES Programming Guide for iOS for techniques to optimize your graphics code.

Good Document Transfer Strategies Can Speed Up Networking

To improve the performance of your networking code, read TN2152: Document Transfer Strategies.

Sample Code

The XMLPerformance sample project explores two approaches to parsing XML, focusing on performance with respect to speed, memory footprint, and user experience.

Performance Tips

Here are some tips to maximize performance: