Documente Academic
Documente Profesional
Documente Cultură
com
AMIYA GUPTA
@amiyagupta
May 29, 2015
Brand new UI
New MSN
Other cool stuff that I wont
have time to talk about
Responsive design
Single Web codebase for all verticals
Perceived Performance
Browser Jenga
Achieving and maintaining fast
rendering performance can be
like playing Jenga
Basic
Intermediate
Advanced
Gzip compression
Basic Practices
Baked In
Configured in a single place in
the core SDK; transparent to
developers
Cookie-less domains
Far future caching headers
CSS and JS bundling
Minification
Domain sharding
Image spriting
Image compression
Basic
Intermediate
Advanced
Async Script
Attribute
The async attribute allows
scripts to load in a non-blocking
fashion.
DNS Prefetch
Links in the <head> hint the
browser to perform DNS
lookups for domains that will be
referenced further down the
page.
DNS lookups
Homepage
Article
Gallery
Video
Above Fold
Lazy-Loading
Images Below
the Fold
Images in the viewport are
fetched immediately, rest are
lazy-loaded
Below Fold
Size Budget
250KB for Above-Fold Content:
HTML
CSS
JS
Images
WOFF
Basic
Intermediate
Advanced
Quantifying
Perceived
Performance
Perceived Performance is
usually measured using
filmstrips of the page rendering
sequence
Visual Metrics
Algorithms like Speed Index and
Page Phase Time attempt to
quantify perceived performance
based on the rate of change of
pixels on the screen. The
resulting metric is usually a
single number.
Our Approach to
Visual Metrics
General purpose metrics are
great, but they can be a little
opaque when it comes to
identifying the cause of a
regression. Our approach
focuses on time taken to render
specific sections of the page.
First Render
What We Learned
Understand
Identify
Fix
Rendering Pipeline
The browser usually cycles
through this process several
times during initial page load.
Killer Combination
Impact
Thats why
Understand
Identify
Fix
F12 Tools
Browser profiling tools are the
best theyve ever been
Perf Markers
Flame charts can be
overwhelming to look at.
Adding performance markers to
critical sections of your code
makes the visualization easier to
understand.
Drilling in with
Perf Markers
Understand
Identify
Fix
Wherever suitable:
Solutions
Example:
Modernizr
Putting Modernizr in the wrong
place resulted in three
consecutive >100ms style
recalculation operations when it
ran its feature detection tests.
350ms
Example:
remToPixel
200x speedup by moving from
external JS to inline head script
Script Location
Execution Time
Before
External JS
86.2ms
After
Inline in <head>
0.5ms
The Future
HTTP/2
Moving to HTTP/2 means we
will have to un-learn some
common best practices
Cookie-less domains
CSS and JS bundling
Domain sharding
Image spriting
In Conclusion
Recap
Links