Transcript
Page 1: Measuring Front-End Performance - What, When and How?

Gareth Hughes, @brassic_lint

Measuring Front-end Performance:

What, When and How?

Gareth Hughes, @brassic_lint

Page 2: Measuring Front-End Performance - What, When and How?

What?

Page 3: Measuring Front-End Performance - What, When and How?

–Akamai study, 2009

http://uk.akamai.com/html/about/press/releases/2009/press_091409.html

“47% of consumers expect a web page to load in 2 seconds or less”

Page 4: Measuring Front-End Performance - What, When and How?

–Akamai study, 2009

“47% of consumers expect a web page to load in 2 seconds or less”

Page 5: Measuring Front-End Performance - What, When and How?

Anatomy of an HTTP request

TTFB(Time to First Byte)

Page 6: Measuring Front-End Performance - What, When and How?

Time to glass

RenderTree

HTML

CSS

DOM

CSSOM

Layout Paint

DOM ContentLoaded Render

Start

JavaScript

DOM

CSSOM

Page 7: Measuring Front-End Performance - What, When and How?

In the browser

http://www.w3.org/TR/navigation-timing/

Page 8: Measuring Front-End Performance - What, When and How?

In the browser

http://www.w3.org/TR/resource-timing/

Page 9: Measuring Front-End Performance - What, When and How?

In the browserfunction myTimings() { performance.mark("startTask1"); doTask1(); // Some developer code performance.mark("endTask1"); performance.mark("startTask2"); doTask2(); // Some developer code performance.mark("endTask2");

}

http://www.w3.org/TR/user-timing/

Page 10: Measuring Front-End Performance - What, When and How?

Speed Index

Page 11: Measuring Front-End Performance - What, When and How?

What?

Page 12: Measuring Front-End Performance - What, When and How?

• Response End / TTFBHow quickly has my server served the base page

• DOM Content LoadedA good analogy for “Page is usable”

• Render Start / First PaintGives us an indication of when the user actually sees something

• Total Page LoadAlthough this includes all 3rd-party and deferred content, it can help get a “feel” for how well everything is working

• User TimingsThis is a little more work, but allows the ability to instrument the areas important to you

• Speed IndexThis is a great single metric to give a pretty good idea of overall user experience

What?

Page 13: Measuring Front-End Performance - What, When and How?

When?

Page 14: Measuring Front-End Performance - What, When and How?

Requirements

Design

Development

Test

Release / Maintenance

Page 15: Measuring Front-End Performance - What, When and How?

–Brad Frost

http://bradfrost.com/blog/post/performance-as-design/

“Good performance is good design”

Page 16: Measuring Front-End Performance - What, When and How?

Performance Budgets• Defines tangible numbers or metrics• May be defined by an aspiration or industry standards• Enforces the performance standards• Instills a “culture of performance” in the project team• Gives a mark to measure by• You probably already have one!• Start vague, but define early• “Performance is everyone’s problem”

Page 17: Measuring Front-End Performance - What, When and How?

When?

At every stage of the lifecycle!

Page 18: Measuring Front-End Performance - What, When and How?

How?

Page 19: Measuring Front-End Performance - What, When and How?

SyntheticDomo arigato, Mr. Roboto

Page 20: Measuring Front-End Performance - What, When and How?
Page 21: Measuring Front-End Performance - What, When and How?

http://www.webpagetest.org • Free!• Real browsers• Global• Scripting• API• Mobile devices• OSS

Page 22: Measuring Front-End Performance - What, When and How?

Real User Monitoring

Page 23: Measuring Front-End Performance - What, When and How?
Page 24: Measuring Front-End Performance - What, When and How?

• sitespeed.ioUses WPT & PhantomJS to run performance audits on site.• Can be used internally (CLI tool)

• PerfBar (http://wpotools.github.io/perfBar/)Surfaces NavTiming data in the browser• Useful on UAT-type environments

• CI plugins• Test for performance as part of the CI process

Other Tools

Page 25: Measuring Front-End Performance - What, When and How?

Reporting Data

Page 26: Measuring Front-End Performance - What, When and How?

SpeedCurvehttps://speedcurve.com

Page 27: Measuring Front-End Performance - What, When and How?

Custom DashboardsGraphite / Splunk

Page 28: Measuring Front-End Performance - What, When and How?

How?• Synthetic

External, controlled testing• Real User Monitoring

Browser-based reporting of real user’s experience• Don’t choose!

Both synthetic and RUM provide valuable insight into performance and should be seen as complementary - either alone gives a narrow view

• ReportDisplay data on dashboards, make it visible and relevant

Page 29: Measuring Front-End Performance - What, When and How?

Summary

• What: Decide what metrics are relevant to User Experience

• When: At every stage of the lifecycle

• How: Using tools and reports to make the data relevant and

actionable

Page 30: Measuring Front-End Performance - What, When and How?

–Ian Malpass, Etsy,

https://codeascraft.com/2011/02/15/measure-anything-measure-everything/

“If it moves, we track it. Sometimes we’ll draw a graph of something that isn’t moving yet, just in case it decides to

make a run for it.”

Page 31: Measuring Front-End Performance - What, When and How?

Gareth Hughes, @brassic_lint

Thank you!http://www.slideshare.net/GarethHughes3

Gareth Hughes, @brassic_lint


Top Related