Measuring Frame Rate with DevTools
What you'll learn: How to use Chrome DevTools to diagnose animation performance issues like dropped frames, jank, and long-running tasks in your React animations.
Why Measure Frame Rate?
You've learned about requestAnimationFrame and compositor-only properties, but how do you know if your animations are actually running smoothly? Even with best practices, performance issues can sneak in. The Chrome DevTools Performance panel is your diagnostic tool for identifying exactly where and why animations stutter.
The 60 FPS Target
Smooth animations require 60 frames per second (16.67ms per frame). When the browser can't maintain this pace, users perceive "jank"—visible stuttering or lag.
Using the Performance Panel
Open DevTools → Performance tab. Click the record button, interact with your animation (trigger that transition, scroll that list), then stop recording. You'll see a flame chart showing everything the browser did.
Key areas to examine:
- FPS meter (green bars): Taller = better. Drops reveal frame rate issues
- Frames timeline: Red corners mark dropped frames—your animation skipped a beat
- Main thread activity: Long yellow blocks are JavaScript execution. If these exceed 16ms during animation, you're blocking the render
- Compositor activity: Green blocks show GPU work on
transform/opacity—these are good!
What to look for:
- Long tasks (>50ms): JavaScript blocking the main thread
- Layout thrashing: Repeated Layout events (purple blocks)
- Paint storms: Excessive paint operations (green blocks)
Think of it like a heart rate monitor during exercise—sudden spikes tell you where your code is "out of breath."
Key Takeaway: Chrome DevTools Performance panel reveals dropped frames and identifies whether jank comes from heavy JavaScript, layout recalculation, or excessive painting—guiding you toward targeted optimizations like using compositor-only properties or debouncing updates.