Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Real-World Performance Budgets [PerfNow 2022]

Real-World Performance Budgets [PerfNow 2022]

Performance budgets have been around for more than ten years. Over those years, we’ve learned a lot about what works, what doesn’t, and what we need to improve. In this session, I revisit old assumptions about performance budgets and offers some new practices. Topics include:

• Aligning budgets with user experience
• Pros and cons of Core Web Vitals
• Budgets for beginners

Tammy Everts

October 27, 2022
Tweet

More Decks by Tammy Everts

Other Decks in Technology

Transcript

  1. How fast should my pages be to keep my visitors

    happy? How can I make sure they stay fast?
  2. 2009 Improved average load time from 6s à 1.2s 7-12%

    increase in conversion rate + 25% increase in PVs Average load time degraded to 5s User feedback: “I will not come back to this site again.” Re-focused on performance 0.4% increase in conversion rate 2010 2011 2009 @tameverts
  3. 1. Constant feature development 2. Badly implemented third-parties 3. Waited

    too long to tackle problems 4. Relied on performance sprints 5. Stopped doing front-end performance measurement 6. No way to track regressions @tameverts
  4. What is a performance budget? Which metrics should I focus

    on? What should my budget thresholds be? How can I stay on top of my budgets? @tameverts
  5. MVB

  6. Thresholds YOU create for metrics that are meaningful for YOUR

    site Milestone timings • e.g. Start Render, Largest Contentful Paint Quantity-based • e.g. Page size, image weight, Long Tasks Score-based • e.g. Cumulative Layout Shift, Lighthouse scores @tameverts
  7. A good performance budget should show you… q What your

    budget is q When you go out of bounds q How long you’re out of bounds q When you’re back within budget @tameverts
  8. Performance budget tools Synthetic (lab) Mimics defined network & browser

    conditions No installation required Limited URLs Limited test locations Compare any sites Detailed analysis & visuals Real user monitoring (field) Real network & browser conditions Requires JavaScript installation Large sample size (up to 100%) Geographic spread Only measure your own site Correlation with other metrics (e.g., bounce rate) @tameverts
  9. ❑ Tracks the most important content ❑ Is accessible out

    of the box ❑ Is available in synthetic and RUM ❑ Can be correlated to UX and business metrics ❑ Has broad browser support The ideal UX metric… @tameverts
  10. ❑ Tracks the most important content ❑ Is accessible out

    of the box ❑ Has broad browser support ❑ Is available in synthetic and RUM ❑ Can be correlated to UX and business metrics √ √ √ Backend time √
  11. Start Render The time from the start of navigation until

    the first non-white content is painted Synthetic & RUM
  12. ❑ Tracks the most important content ❑ Is accessible out

    of the box ❑ Has broad browser support ❑ Is available in synthetic and RUM ❑ Can be correlated to UX and business metrics √ √ √ Start Render √ √ @tameverts
  13. Largest Contentful Paint (LCP) Amount of time it takes for

    the largest visual element (image or video) to render Synthetic & RUM
  14. ❑ Tracks the most important content ❑ Is accessible out

    of the box ❑ Has broad browser support ❑ Is available in synthetic and RUM ❑ Can be correlated to UX and business metrics √ √ Largest Contentful Paint √ √ @tameverts
  15. Cumulative Layout Shift (CLS) Aggregate score that reflects how much

    page elements shift during rendering Synthetic & RUM
  16. Bounce rate gets worse as CLS degrades Bounce rate improves

    as CLS degrades Bounce rate stays the same as CLS degrades speedcurve.com/blog/google-cumulative-layout-shift/
  17. ❑ Tracks the most important content ❑ Is accessible out

    of the box ❑ Has broad browser support ❑ Is available in synthetic and RUM ❑ Can be correlated to UX and business metrics √ √ Cumulative Layout Shift @tameverts √
  18. First Input Delay (FID) Amount of time it takes for

    the page to respond to user input (e.g., click, tap, key) RUM
  19. ❑ Tracks the most important content ❑ Is accessible out

    of the box ❑ Has broad browser support ❑ Is available in synthetic and RUM ❑ Can be correlated to UX and business metrics √ First Input Delay @tameverts
  20. Long Tasks Any JavaScript function that takes >50ms to execute

    Long tasks don’t always block page rendering, but they can cause page jank Synthetic & RUM
  21. 61

  22. Interaction to Next Paint (INP) Measures a page's responsiveness to

    individual user interactions Observes latency and reports a single value which all (or nearly all) interactions were below RUM
  23. Element Timing Measures when specified DOM elements are rendered (and

    works in SPAs) You decide which element(s) you want to measure RUM & Synthetic
  24. Meaningful content Usable out of the box Broad browser support

    Synthetic RUM Correlates to business/UX Time to First Byte ★ ★ ★ ★ ☆ Start Render ☆ ★ ★ ★ ★ ★ Largest Contentful Paint ☆ ★ ★ ★ ★ Cumulative Layout Shift ☆ ☆ ★ ★ First Input Delay ★ ★ Long Tasks ★ ★ ★ ★ ☆ Interaction to Next Paint ☆ ★ Element Timing ★ ★ ★ ★ ★ @tameverts
  25. Meaningful content Usable out of the box Broad browser support

    Synthetic RUM Correlates to business/UX Time to First Byte ★ ★ ★ ★ ☆ Start Render ☆ ★ ★ ★ ★ ★ Largest Contentful Paint ☆ ★ ★ ★ ★ Cumulative Layout Shift ☆ ☆ ★ ★ First Input Delay ★ ★ Long Tasks ★ ★ ★ ★ ☆ Interaction to Next Paint ☆ ★ Element Timing ★ ★ ★ ★ ★ @tameverts
  26. Goals are aspirational How fast do I want to be

    eventually? Budgets are pragmatic How can I keep my site from getting slower while I work toward my goals? @tameverts
  27. 79

  28. Everyone* who touches a page should understand the performance impact

    of their choices *Yes, this includes marketing people
  29. “One of the original directives of the performance team was

    we weren’t going to set ourselves up to be performance cops.” Dan Chilton, Vox Media responsivewebdesign.com/podcast/vox-media-performance/
  30. Our goals • Set up best practices • Make recommendations

    • Be a resource within the company that people can turn to when they have to make performance-related decisions Dan Chilton, Vox Media responsivewebdesign.com/podcast/vox-media-performance/
  31. 1. Start small (even a single metric will do!) 2.

    Visually validate your metrics (filmstrips, videos) 3. Validate your metrics some more (UX, business) 4. Get buy-in from different stakeholders 5. Focus on the pages that matter most 6. Revisit your budgets regularly (2-4 weeks) 7. Remember that metrics are always evolving 8. Never stop measuring
  32. Performance Budgets 101 support.speedcurve.com/docs/performance-budgets-101 Setting a Performance Budget timkadlec.com/2013/01/setting-a-performance-budget/ Performance

    Budgets, Pragmatically csswizardry.com/2020/01/performance-budgets-pragmatically/ Web Vitals web.dev/vitals/ Element Timing: One true metric to rule them all? speedcurve.com/blog/element-timing-one-true-metric/ First Input Delay: How vital is it? speedcurve.com/blog/first-input-delay-google-core-web-vitals/ Cumulative Layout Shift: What it measures (and what it doesn’t) speedcurve.com/blog/google-cumulative-layout-shift/