Daily iOS
Performance and debugging

Analyzing scroll hitches

A photo feed collection view stutters while scrolling. How do you use Instruments to tell whether the cause is image decoding, layout computation, or cell setup?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Use the Animation Hitches template to get the exact time of the hitched frame and whether it was late in the commit stage or the render stage, then open the main thread call stack at that moment in Time Profiler on the same trace and read the heaviest frame: an image decoding function, layoutSubviews and the Auto Layout engine, or the setup code inside cellForItemAt.

Share a question