Identify scroll view frame drops using Instruments

Viewed 2382

Is there any way to identify the exact place in code (e.g. a long-running function, or waiting on a lock) that causes a frame drop, using Instruments and/or Xcode?

I'm trying to make the scrolling of my scroll view as smooth as possible, and the FPS sometimes drops to 59 or even 58, while remaining 60 roughly half of the time, so I'd like to know what exactly is causing this.

I did enable the Record Waiting Threads flag in the CPU Usage instrument of the Core Animation template, and it does show needle-like spikes of 100% usage of each core from time to time (close to the seconds with dropped frames), but I can't seem to figure out a way to identify the exact place in the code causing the drop - all the functions being called are pretty low impact and in single-digit percentages (so this may very well be the main thread waiting for a lock).

1 Answers
Related