SlideShare uma empresa Scribd logo
1 de 107
Baixar para ler offline
STARRING KATIE SYLOR-MILLERAND ETSY FRONTEND SYSTEMS
Katie Sylor-Miller
Staff Software Engineer
Etsy Frontend Systems
@ksylor && @ohshitgit
WE DO NOT FOLLOW MAPS TO BURIED TREASURE,
AND “X” NEVER, EVER MARKS THE SPOT
Archaeology is the
study of human history
and culture through
physical remains
Performance
archaeology uncovers
insights into your
development culture
Survey
Excavate
Hypothesis
Interpret
Archaeology 101
YOU CALL THIS ARCHAEOLOGY?
Hypothesis
Image by HeritageDaily on Wikipedia
The Mobile Listing Page
Mobile Visits
67% 52%
Mobile GMS
RUM Dom Content Loaded Times
1000 2000 3000 4000 50000
DOMContentLoaded ms
Numberofvisits
Dom Content Loaded Times
15%
37%
24%
13%
6%
1000 2000 3000 4000 50000
DOMContentLoaded ms
Numberofvisits
Conversion Vs. Dom Content Loaded
1000 2000 3000 4000 5000
DOMContentLoaded ms
Conversionrate
1000 2000 3000 4000 5000
Conversion Vs. Population
15%
37%
24%
13%
6%
DOMContentLoaded ms
Conversionrate
Improving the
performance of the
mobile listing page will
increase conversion
Hypothesis
FORTUNE AND GLORY, KID
Survey
Hypothesis
Performance Best Practices
Great server response times
Minify and gzip static JS and CSS assets
Resize and compress images
Responsive images
Use proper headers to take advantage of browser caching
Use dns-prefetch resource hints
Use HTTP/2 when available (not all of our CDNs support)
In-house RUM monitoring and alerting
3rd party synthetic monitoring service
NOW WHAT?
Critical Rendering Path
How quickly a user:
• receives confirmation that the page has started loading?
• sees the most important information on the page?
• can interact with the page?
NOW WHAT?
Ground Penetrating Radar
Image by Tapatio via Wikipedia
WebPageTest.org
Ground Penetrating Radar
The Mobile Listing Page
WebPageTest Results (Before)
iPhone 6 iOS9 - 3GSlow 

(this is much worse than our typical user experience)
METRIC BEFORE AFTER CHANGE
TTFB 1.8s
Start Render 8.5s
DOM Content Loaded 12.1s
Speed Index 13,193
Time to First Interactive >19s
CSS size 98KB/0.62MB
JS size 386KB/1.46MB
Images 37
Cost $$$$-
PRETEND THIS DIDN’T HAPPEN
Waterfall (before)
Waterfall (before)
Five CSS files

Block CSSOM construction

and Start Render
Waterfall (before)
Related listings images

(below the fold)
Waterfall (before)
Two different sizes of shop avatar image

(1 above, 1 below the fold)
Waterfall (before)
Three JS files

Global base (XL), page-specific (L), category nav(S)

Block DOM Content Loaded
Waterfall (before)
Similar listing images

(waaaayyyyy below the fold)
Five CSS bg-images

One icon font
Main listing image is 36th!!!

Followed by more carousel images
Reviews images (from async content)
Logging
Logging
Logging
$(‘document’).ready()
Areas For Improvement
• Lazyload images: 

Defer loading of “below the fold” images
• Reduce CSS File Size: 

Combine CSS files and remove unused rules
• Switch to SVGs: 

Replace CSS bg-images and icon fonts with SVGs
• Reduce JS File Size: 

Remove unused Javascript
Survey
Excavate
Test Pits
Lazyload
Images
Test Pit #1
37 Images
814KB
lazy loading synthetic tests
DOMContentLoadedms
1750
3500
5250
7000
Network Speed
Wifi 4G 3G
Before
After Lazy Loading
Reduce CSS
File Size
Test Pit #2
5 CSS files
98KB/0.62MB
“Load only what you need”
- Yoav Weiss, yesterday
EASIER SAID THAN DONE
Automation to the Rescue?
• Selenium script opens the page(s) in a browser
• Run uncss (https://github.com/uncss/uncss)
• Output a new file with only the CSS in use
… But, we didn’t capture *all* states and had to keep adding
more every time we found a bug.
CSS Reduction Synthetic Tests
DOMContentLoaded(ms)
1750
3500
5250
7000
Network Speed
Wifi 4G 3G
Before
After CSS Reduction
After Lazy Loading
Lazyloading + CSS
Reduction
Experiment Results
User-facing experiment #1
RUM Results - Lazyloading + CSS Reduction
METRIC BEFORE AFTER CHANGE
TTFB 1.16s 1.18s 1.2%
DOM Content Loaded 3.3s 3.1s 6% ➡
Page Load 6.0s 5.2s 13.2% ➡
RUM Results - Lazyloading + CSS Reduction
Conversion
X MARKS THE SPOT
Switch to
SVGs
Test Pit #3
5 bg-images
1 icon font
SVG Switch Synthetic Tests
Logged Out
DOMContentLoadedms
1500
3000
4500
6000
Wifi 4G 3G
Before
After SVGs
Logged In
1500
3000
4500
6000
Wifi 4G 3G
Before
After SVGs
SVG Switch
Results
User-facing Experiment #2
RUM Results - SVG Switch
METRIC BEFORE AFTER CHANGE
TTFB 1.17 1.17s ⬌
DOM Content Loaded 3.0s 3.0s ⬌
Page Load 5.6s 5.5s 1%➡
RUM Results - SVG Switch
Conversion ⬌
WebPageTest.org
again
How are we doing?
METRIC BEFORE AFTER CHANGE
TTFB 1.8s 2.0s 11%
Start Render 8.5s 4.8s 44% ➡
DOM Content Loaded 12.1s 12.6s ?? 4%
Speed Index 13,193 13,071 ⬌
Time to First Interactive >19s >17s 10%➡
CSS size 98KB/0.62MB 38KB/0.24MB 60%➡
JS size 386KB/1.46MB 375KB/1.59MB 3%
Images 37 25 32%➡
Cost $$$$- $$$-- $➡
WebPageTest Results (After)
iPhone 6 iOS9 - 3GSlow
Waterfall - After
Down to 2 CSS Files!
Waterfall - After
Listing carousel images!
Waterfall - After
One shop avatar image!
Waterfall - After
Still two large JS files
Waterfall - After
CSS Background image

added back in by experiment
Logging
Reviews images (added by new experiment)
Async content
Stratigraphy
A Brief History of JS at Etsy
2010 - jQuery w/Homegrown system to
concatenate and serve JS files
2011 - Dependencies get inlined using rails-style

//=require ‘path/to/dependencies’

window.Etsy.module;
2012 - RequireJS - AMD dependencies

define([‘path/to/dependencies’],

function(dep) { });
2017 - still a mix of everything :(
HA HAAAAAHA
Reduce JS
File Size
Test Pit #4
“Load only what you need”
- Yoav Weiss, yesterday
56KB/264KB
121 dependencies
142KB/712KB
124 dependencies
PAGE-SPECIFIC FILE GLOBAL BASE FILE
NO TYPES!
Manual JS
Reduction
Test Pit #4a
How to be a Javascript Detective
JS dependency
$(‘selector’)

Smarty/Mustache

templates
PHP View
PHP Controller
Experiment flags
56KB/264KB
42KB/177KB
25% ➡
142KB/712KB
94KB/469KB
33% ➡
PAGE-SPECIFIC FILE GLOBAL BASE FILE
WebPageTest Results (After)
Manual JS removal
METRIC BEFORE AFTER CHANGE
TTFB 2.0s 1.9s 5%➡
Start Render 4.8s 4.87s 1%
DOM Content Loaded 12.6s 9.8s 22%➡
Speed Index 13,071 10,903 16%➡
Time to First Interactive >17s >15s 12%➡
CSS size 38KB/0.24MB 38KB/0.24MB ⬌
JS size 375KB/1.59MB 299KB/1.15MB 20%➡
Images 25 23 8%➡
Cost $$$-- $$$-- ⬌
iPhone 6 iOS9 - 3GSlow
Manual JS
Reduction Results
User-facing Experiment #3
RUM Results - Manual JS Reduction
METRIC BEFORE AFTER CHANGE
TTFB 1.2s 1.2s ⬌
DOM Content Loaded 2.9s 2.8s 2.9%➡
Page Load 5.6s 5.5s 1.6%➡
RUM Results - Manual JS Reduction
Conversion ➡
Javascript
Instrumentation
Test Pit #4b
Code Coverage?
window.Etsy = 

window.Etsy || {};

window.Etsy.Vimes.register

(“vb383”);



function vb383(id,fn) {

return function() {

window.Etsy.Vimes.start('vb383'
, id);

return fn.apply(this,
arguments);

};

}

return vb383(1, function(args)
{ 

return stuff;

}
Re-write JS to log

function calls
Capture real user

actions
Send logs onLoad

and onUnLoad
Map # of calls back

to source files
Introducing Vimes
PAGE-SPECIFIC FILE
56KB/264KB
40KB/173KB
28% ➡
142KB/712KB
89KB/448KB
37% ➡
GLOBAL BASE FILE
Instrumented JS
Reduction Results
Fourth Experiment
RUM Results - Instrumented JS
METRIC BEFORE AFTER CHANGE
TTFB 1.2s 1.2s ⬌
DOM Content Loaded 3.0s 2.9s 2.7%➡
Page Load 5.2s 5.1s 1.2%➡
RUM Results - Instrumented JS
Conversion
Excavate
Interpret
Performance directly
affects conversion
Frontend performance
is just as important as
backend, if not more.
PUT IT IN THE BROWSER AND FORGET IT
Our experiences are not
our users experiences
(especially on mobile)
Small-scale tweaks
don’t always pan out
Your front-end architecture
needs to match your
development culture
Static top-level
CSS or JS
dependency
managed at the
page level
Dynamic FE
dependency
management at
the component
level
WHAT WE HAVE WHAT WE NEED
Architect for deletion
THANK YOU

Mais conteúdo relacionado

Semelhante a Raiders of the Fast Start: Frontend Performance Archaeology PerfmattersConf 2018

Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Katie Sylor-Miller
 
HyperLight Websites
HyperLight WebsitesHyperLight Websites
HyperLight Websites
FITC
 
SpeedGeeks
SpeedGeeksSpeedGeeks
SpeedGeeks
xlight
 

Semelhante a Raiders of the Fast Start: Frontend Performance Archaeology PerfmattersConf 2018 (20)

Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
 
Speed is Essential for a Great Web Experience
Speed is Essential for a Great Web ExperienceSpeed is Essential for a Great Web Experience
Speed is Essential for a Great Web Experience
 
WebPerformance: Why and How? – Stefan Wintermeyer
WebPerformance: Why and How? – Stefan WintermeyerWebPerformance: Why and How? – Stefan Wintermeyer
WebPerformance: Why and How? – Stefan Wintermeyer
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
 
Windy cityrails performance_tuning
Windy cityrails performance_tuningWindy cityrails performance_tuning
Windy cityrails performance_tuning
 
How and Why ($) to improve web performance.pdf
How and Why ($) to improve web performance.pdfHow and Why ($) to improve web performance.pdf
How and Why ($) to improve web performance.pdf
 
HyperLight Websites
HyperLight WebsitesHyperLight Websites
HyperLight Websites
 
Speed is Essential for a Great Web Experience (Canvas Conf Version)
Speed is Essential for a Great Web Experience (Canvas Conf Version)Speed is Essential for a Great Web Experience (Canvas Conf Version)
Speed is Essential for a Great Web Experience (Canvas Conf Version)
 
The Need for Speed, Optimizing the User Experience pt2 - UXPA Boston 2014 - J...
The Need for Speed, Optimizing the User Experience pt2 - UXPA Boston 2014 - J...The Need for Speed, Optimizing the User Experience pt2 - UXPA Boston 2014 - J...
The Need for Speed, Optimizing the User Experience pt2 - UXPA Boston 2014 - J...
 
Optimizing for a faster user experience Pt 2: How-to.
Optimizing for a faster user experience Pt 2: How-to.Optimizing for a faster user experience Pt 2: How-to.
Optimizing for a faster user experience Pt 2: How-to.
 
Profilling client performance
Profilling client performanceProfilling client performance
Profilling client performance
 
Imagesandvideo stockholm fastandbeautiful
Imagesandvideo stockholm fastandbeautifulImagesandvideo stockholm fastandbeautiful
Imagesandvideo stockholm fastandbeautiful
 
SpeedGeeks
SpeedGeeksSpeedGeeks
SpeedGeeks
 
In Search of Speed
In Search of SpeedIn Search of Speed
In Search of Speed
 
Hacking Web Performance
Hacking Web Performance Hacking Web Performance
Hacking Web Performance
 
10 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 201610 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 2016
 
Shopzilla - Performance By Design
Shopzilla - Performance By DesignShopzilla - Performance By Design
Shopzilla - Performance By Design
 
Fastandbeautiful yglf
Fastandbeautiful yglfFastandbeautiful yglf
Fastandbeautiful yglf
 
The need for Speed: Advanced #webperf - SEOday 2018
The need for Speed: Advanced #webperf - SEOday 2018The need for Speed: Advanced #webperf - SEOday 2018
The need for Speed: Advanced #webperf - SEOday 2018
 

Mais de Katie Sylor-Miller

Mais de Katie Sylor-Miller (7)

Happy Browser, Happy User! WordSesh 2019
Happy Browser, Happy User! WordSesh 2019Happy Browser, Happy User! WordSesh 2019
Happy Browser, Happy User! WordSesh 2019
 
Happy Browser, Happy User! - PerfMatters Conference 2019
Happy Browser, Happy User! - PerfMatters Conference 2019Happy Browser, Happy User! - PerfMatters Conference 2019
Happy Browser, Happy User! - PerfMatters Conference 2019
 
Design Systems + Git = Success - Clarity Conference 2018
Design Systems + Git  = Success - Clarity Conference 2018Design Systems + Git  = Success - Clarity Conference 2018
Design Systems + Git = Success - Clarity Conference 2018
 
Images for Everyone - ImageCon 2018
Images for Everyone - ImageCon 2018Images for Everyone - ImageCon 2018
Images for Everyone - ImageCon 2018
 
Git-ing out of your git messes - Fluent Conf 2017
Git-ing out of  your git messes - Fluent Conf 2017Git-ing out of  your git messes - Fluent Conf 2017
Git-ing out of your git messes - Fluent Conf 2017
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messes
 
Putting the t in team
Putting the t in teamPutting the t in team
Putting the t in team
 

Último

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 

Último (20)

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 

Raiders of the Fast Start: Frontend Performance Archaeology PerfmattersConf 2018