---
title: "#113: Profiling Core Animation 🏃📈"
url: https://littlebitesofcocoa.com/113-profiling-core-animation
author: Jake Marsh
published: 2015-10-28
topics: ["Profiling","Tools"]
description: "We covered how to analyze the performance of our app using the Time Profiler Instrument in Bite #68, now we'll take a look at how to do the same for how..."
---

# #113: Profiling Core Animation 🏃📈

By Jake Marsh, October 28, 2015. HTML: https://littlebitesofcocoa.com/113-profiling-core-animation

We covered how to analyze the performance of our **app** using the **Time Profiler** Instrument in [Bite #68](https://littlebitesofcocoa.com/68), now we'll take a look at how to do the same for how quickly our **app** draws its content to the device's display. Let's get started.

First, the basics: **iOS** wants to render content to the display <i>60 times per second</i>. If our code can't keep up with that speed, some frames won't be drawn, and our **app's** UI will appear to lag and "skip" as things move around on screen. Even the slightest dip below 60 frames per second can make an **app** feel quite sluggish.  One of the main places in our code this can be a challenge is when scrolling complex **table** and **collection views**. Let's look at how Instruments can help us identify and track down the cause of slow rendering **views** in our **app**:

We'll start **Profiling** like in [Bite #68](https://littlebitesofcocoa.com/68). When _Instruments_ launches, we'll select the _Core Animation Instrument_ and click **Profile**. Unlike before, we'll see <i>two</i> <i>different</i> **gauges** at the top of our screen.

<img src='https://media.littlebitesofcocoa.com/bite-assets/113-profiling-core-animation-instrument-icon.png' style='max-width: 98px; float: right; margin-left: 20px; margin-bottom: 20px;' />

We're starting to unlock some of the power of  Instruments here. The _Core Animation Instrument_ measures our **app's** rendering performance <i>simultaneously</i> with our code's performance.  We'll scroll our table view for a bit then find a part of the graph where we dip below 60 fps. We'll drag to select it, then select the **Time Profiler** gauge. Now we can use the techniques we learned in [Bite #68](https://littlebitesofcocoa.com/68) to track down the offending slow **function(s)**.

<img src='https://media.littlebitesofcocoa.com/bite-assets/113-profiling-core-animation-debug-options-panel.png' style='max-width: 194px; float: left; margin-right: 20px; margin-bottom: 20px;' /> Now the really fun stuff: We can click the <img src='https://media.littlebitesofcocoa.com/bite-assets/113-profiling-core-animation-debug-options-icon.png' style='max-width: 24px;' /> in the lower right-hand sidebar to show the **Debug Options** panel. These options alter how our app is drawn in <i>real-time</i> to help find problems. Here's a couple of the most helpful ones:

**Color Blended Layers** will tint views <span style='color: #FF0000'>red</span> that are being blended. Try to avoid non-opaque views or views with a clear background color.

**Color Offscreen-Rendered Yellow** will tint views that have been rendered <i>twice</i> - once on and once off-screen, <span style='color: #A99E16'>yellow</span>.

Remember, <i>speed is a feature</i>. Rendering speed is no different. Fast drawing means happy users!
