Performance Budgets for the Real World by Tammy Everts

ScyllaDB 151 views 83 slides Jul 01, 2024
Slide 1
Slide 1 of 83
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83

About This Presentation

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, Tammy revisits old assumptions about performance budgets and offers some new best practices. Topics include:

• Unde...


Slide Content

Performance Budgets for the Real World Tammy Everts CXO at SpeedCurve

Tammy Everts (she/her) CXO at SpeedCurve Author of ‘Time Is Money: The Business Value of Web Performance’ (O’Reilly) Co-chair of performance.now() Co-curator of WPOstats.com Used to own Uber.com

Improved average load time from 6s to 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

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

timkadlec.com/2013/01/setting-a-performance-budget/

csswizardry.com/2020/01/performance-budgets-pragmatically/

“Fighting regressions took priority over optimizations. The reason we decided this was because in the past, when we had performance efforts, engineers who were working on optimizations couldn’t really see progress in our performance metrics, because there were so many regressions happening at the same time .” Michelle Vu, Pinterest perfnow.nl/2018#michelle

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?

What is a performance budget?

Thresholds YOU create for metrics that are meaningful for YOUR site Time-based • Start Render, Largest Contentful Paint Quantity-based • Page size, image weight, Long Tasks Score-based • Cumulative Layout Shift, Lighthouse scores

Monitoring 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)

A good performance budget shows you… What your budget is When you go out of bounds How long you’re out of bounds When you’re back within budget

Budgets can be passive (e.g., charts) Get alerts so you can investigate B reak the build

budget exceeded fixed oops

Which metrics should I focus on?

TTFB DNS FCP FMP LCP CLS FID TBT TTI INP OMG WTF

50+ synthetic metrics 30+ RUM metrics 25 additional metrics for EACH third party ∞ custom metrics

MVB

MVB Minimum Viable Budgets

Is the page loading? Can I use it? How does it feel?

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…

Is the page loading?

The time from the start of the initial navigation until the first byte is received by the browser (AKA Time to First Byte) Synthetic & RUM Backend time

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 √

The time from the start of navigation until the first non-white content is painted Synthetic & RUM Start Render

As Start Render improves, so does bounce rate (typically)

So does conversion rate (again, typically)

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 √ √

Can I use the page?

When do users start interacting with a page?

Amount of time it takes for the largest visual element (image or video) to render Synthetic & RUM (Chromium browsers only) Largest Contentful Paint

Largest Contentful Paint (often) correlates to bounce rate

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 √ √

When the last piece of critical content (hero image, first H1) is painted in the browser. Synthetic Last Painted Hero

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 √ √ Last Painted Hero √

How does the page feel?

Aggregate score that reflects how much page elements shift during rendering Synthetic & RUM (Chromium browsers only) Cumulative Layout Shift

Bounce rate gets worse as CLS degrades Bounce rate improves as CLS degrades Bounce rate stays the same as CLS degrades

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 √

Any JavaScript function that takes >50ms to execute Long Tasks don’t always block page rendering, but they can cause the page to feel janky Synthetic & RUM Long Tasks

Long Tasks often correlate to conversions

Long Tasks Time can expose issues with third parties

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 √ √ Long Tasks Time √ √

Measures a page's responsiveness to individual user interactions Observes latency and reports a single value that all (or nearly all) interactions are below RUM Interaction to Next Paint

INP often correlates to user behaviour (e.g., conversions)

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 √ Interaction to Next Paint √ √

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 ☆ ★ ★ ★ ★ Last Painted Hero ☆ ★ ★ ★ Cumulative Layout Shift ☆ ☆ ★ ★ Long Tasks ★ ★ ★ ★ ☆ Interaction to Next Paint ★ ★ ★ ★

YMMV

What should my budget thresholds be?

performance budgets ≠ performance goals

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?

X

demoralizing not actionable ignorable

As you optimize your pages (and hopefully get faster!) update your budgets

How do I manage my budgets?

Should I set up budgets in RUM, synthetic, or both?

Scenario 1 Create budgets in RUM, and drill down via synthetic

Scenario 2 Create budgets in synthetic, and integrate with CI/CD

Do I need performance budgets for all my pages?

1. Product 2. Category 3. Home 4. Cart 5. Search

Who should be responsible for managing budgets?

Everyone* who touches a page should understand the performance impact of their choices *Yes, this includes marketing people

For example… If your marketing team is responsible for adding and maintaining third-party tags, they should: Have a basic understanding of the metrics (such as Long Tasks Time) Collaborate on setting the budget Receive alerts when the budget is violated Participate (or at least have visibility) in identifying and fixing the issue

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

Tammy Everts @webperf.social/@tammy @tameverts speedcurve.com/blog Thank you! Let’s connect.

A Complete Guide to Performance Budgets speedcurve.com/blog/performance-budgets/ 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/ Farewell FID… hello Interaction to Next Paint speedcurve.com/blog/interaction-to-next-paint-core-web-vitals/ Cumulative Layout Shift: What it measures (and what it doesn’t) speedcurve.com/blog/google-cumulative-layout-shift/
Tags