12. Tuning for Speed

Code should run as fast as necessary, but no faster.

Richard E. Pattis

In Parts I and II, we learned about the awesome drawing and animation features that Core Animation has to offer. Core Animation is powerful and fast, but it’s also easy to use inefficiently if you’re not clear what’s going on behind the scenes. There is an art to getting the best performance out of it. In this chapter, we explore some of the reasons why your animations might run slowly and how you can diagnose and fix problems.

CPU Versus GPU

There are two types of processor involved in drawing and animation: The CPU (central processing unit) and GPU (graphics processing unit). On modern iOS devices, these are both programmable chips that can run (more ...

Get iOS Core Animation: Advanced Techniques now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.