Perceived performance is not only about fast page loads and delivering the content as early as possible. It is also about all the interactions happening on an already loaded page. Understanding what happens under the browsers hood can help you avoid potential performance issues.
1 of 77
Downloaded 10 times
More Related Content
Fast but not furious: debugging user interaction performance issues
1. Front-end Dev & Designer
at Lunar Logic
Anna Migas
Google Developer Expert
WebMuses core team
8. Optimise Critical Rendering Path
Use progress bars instead of spinners
Have a placeholder content
Start upload before user even
decides to click the upload button
17. Agenda
1. Why sometimes interactions feel slow
2. Browser rendering and frames
3. Types of triggered changes in the UI
4. How to test for interaction performance
5. Potentially dangerous user interface patterns
37. What creates new layers?
1. 3D or perspective transforms
2. Animated 2D transforms or opacity
3. Being on top/a child of a compositing layer
4. Accelerated CSS filters
5. In special cases <video>, <canvas>, plugins
6. will-change CSS property
60. Animations
1. Dont overuse animations
2. Animate only transform and opacity if possible
3. For 120fps avoid requestAnimationFrame()
4. Dont animate elements below other nodes (like
fixed headers)
5. Dont animate too many elements
63. Parallax effect
1. Causes Paint Storms
2. Almost always bad
3. Dont use scroll events
4. Dont use background-position
5. Use 3D transforms and perspective if you need
to: https://developers.google.com/web/updates/
2016/12/performant-parallaxing
66. Fixed elements
1. Repaints with every frame when scrolling
2. Use will-change property (or transform:
translate3D(0,0,0)) to avoid repainting
.fixed-element {
position: fixed;
will-change: transform;
}
68. Scrolling events
1. Dont attach wheel or touch listeners to the whole
document, use smaller areas instead
2. Take advantage of passive event listeners (use
with polyfill):
window.addEventListener("scroll", func, {passive: true});
71. Hover effects
1. If they are bound to happen oftenyou might
consider using will-change property
2. Can be deadly if there are too many and can be
easily triggered
3. Avoid effects triggering Layout or Paint:
https://csstriggers.com/
74. Appending elements
1. Make sure not many elements will be affected
2. Try to separate the area (will-change, contain:
layout)
3. Try not to change the size of area (for example
use overflow property)
75. Summary
1. Jank happens when the browser doesnt finish
rendering a frame on time
2. Try to offload and optimise the main thread
3. Avoid content Reflows and Repaints
4. Dont overuse layers
5. Test your website with Performance, Layers and
Rendering tabs
6. Use responsibly potentially dangerous UI patterns