Overview
Smooth animations run at 60 FPS (frames per second), meaning the browser redraws the screen every 16.67 milliseconds. When animations drop below this threshold, they appear janky or stuttery. This tool helps you:- Track real-time FPS during animations
- Compare performance of different animation approaches
- Identify performance bottlenecks
- Learn optimization techniques
Most modern displays refresh at 60Hz, so 60 FPS is the target for smooth animations. Some displays support higher refresh rates (120Hz, 144Hz), but 60 FPS is the baseline.
FPS tracking features
The Performance Metrics tool usesrequestAnimationFrame to measure frame rates accurately.
Real-time monitoring
Click “Start Monitoring” to begin tracking FPS. The tool measures the time between frames:- Recording the timestamp of each frame
- Calculating the time difference (delta) between frames
- Converting to FPS:
1000ms / delta = frames per second - Storing the last 50 measurements for visualization
FPS visualization
The tool displays a live graph showing FPS over time:- Full height: 60 FPS (optimal)
- Half height: 30 FPS (noticeable jank)
- Short bars: Significant performance issues
Average FPS calculation
The tool shows the average FPS across all measurements:How to interpret metrics
Understanding FPS numbers helps you diagnose performance issues.FPS ranges and what they mean
60 FPS
Excellent - Smooth, buttery animations with no visible jank
45-59 FPS
Good - Mostly smooth with occasional minor stutters
30-44 FPS
Noticeable jank - Visible stuttering, needs optimization
Below 30 FPS
Poor - Significant performance issues, unusable
Reading the FPS graph
Look for these patterns: Stable horizontal line at top: Consistent 60 FPS - perfect performance Slight variations: Normal - minor fluctuations are expected Sudden drops: Performance spikes - indicates expensive operations Consistently low: Systemic issues - animation approach needs rethinkingCommon causes of low FPS
Animating expensive properties
Animating expensive properties
Properties like
width, height, top, left trigger layout recalculation. Use transform and opacity instead.Too many simultaneous animations
Too many simultaneous animations
Animating hundreds of elements simultaneously overwhelms the browser. Stagger animations or reduce quantity.
Forced synchronous layouts
Forced synchronous layouts
Reading layout properties (offsetWidth, scrollTop) during animation causes reflows. Read values before animating.
No hardware acceleration
No hardware acceleration
Modern browsers can offload animations to the GPU. Use transform and opacity, or explicitly promote elements with will-change.
Performance comparison test
The tool includes an interactive comparison showing the performance impact of different animation approaches.Transform vs layout properties
Compare animating withtransform versus top/left:
Testing with different quantities
Adjust the slider to see how animation count affects performance:- 1-10 elements: Should maintain 60 FPS easily
- 10-50 elements: May see minor FPS drops
- 50-100 elements: Likely to see significant performance impact
Why transform performs better
The browser rendering pipeline has three main stages:
Different CSS properties trigger different stages:
| Property | Triggers | Performance |
|---|---|---|
width, height, left, top | Layout → Paint → Composite | Slowest |
color, background-color | Paint → Composite | Moderate |
transform, opacity | Composite only | Fastest |
transform, the browser can skip layout and paint entirely, offloading work to the GPU.
Optimization tips based on metrics
Use these strategies when metrics reveal performance issues:Use will-change sparingly
Thewill-change CSS property tells the browser to optimize for upcoming changes:
will-change dynamically:
Promote to new compositor layer
For elements that animate frequently, create a compositor layer:Debounce scroll handlers
Scroll-based animations can fire hundreds of times per second:requestAnimationFrame:
Reduce paint area
Minimize the area that needs repainting:Use transform instead of multiple properties
Combine transforms into a single property:Avoid animating box-shadow
box-shadow is expensive to animate. Use alternatives:
Monitoring workflow
Start with baseline measurement
Click “Start Monitoring” with no animations running to see baseline performance.
Enable animations
Add animations and observe FPS changes. Significant drops indicate performance issues.
Test different quantities
Increase the number of animated elements until you see FPS drops. This reveals your performance budget.
Browser DevTools integration
For deeper performance analysis, use browser developer tools alongside this tool:Chrome DevTools Performance panel
- Open DevTools (F12)
- Go to Performance tab
- Click Record
- Interact with animations
- Stop recording
- Long frames (yellow/red bars) - frames taking >16ms
- Layout/Reflow events - expensive operations
- Paint events - areas being redrawn
Firefox Performance tool
- Open DevTools (F12)
- Go to Performance tab
- Click Start Recording Performance
- Interact with animations
- Stop recording
- Frame rate graph - should be consistently high
- Waterfall - shows what’s happening in each frame
- Call tree - identifies expensive functions
Best practices summary
Animate transform and opacity
These properties are GPU-accelerated and skip layout/paint stages
Promote heavy animations
Use will-change or transform3d for frequently animated elements
Debounce scroll handlers
Limit scroll-based animations to maintain 60 FPS
Reduce animated elements
Animate only what’s necessary - fewer elements = better performance
Avoid layout thrashing
Batch DOM reads and writes, don’t interleave them
Test on low-end devices
Performance on your development machine doesn’t reflect user experience
Next steps
Animation comparison
Compare different animation techniques
Animation challenges
Practice optimization with guided challenges