Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Building for performance and resilience
Search
Andy Hume
June 17, 2014
Technology
5
1.1k
Building for performance and resilience
Andy Hume
June 17, 2014
Tweet
Share
More Decks by Andy Hume
See All by Andy Hume
Architecting resilient front-ends, jQuery UK, 2015
andyhume
2
1.1k
Architecting resilient front ends
andyhume
3
800
Guardian Responsive Design, SmashingConf 2013
andyhume
6
590
Web Fonts as a Progressive Enhancement, Ampersand 2013
andyhume
2
740
Anatomy of a responsive page load, WhiskyWeb 2013
andyhume
10
1.8k
Breaking News & Breaking Software, SyncConf 2013
andyhume
0
240
Anatomy of a responsive page load, Responsive Day Out 2013
andyhume
23
3.3k
Responsive Guardian
andyhume
21
1k
CSS for grown ups: maturing best practises, SXSW 2012
andyhume
101
47k
Other Decks in Technology
See All in Technology
ハイパーパラメータチューニングって何をしているの
toridori_dev
0
140
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
3
490
スクラムチームを立ち上げる〜チーム開発で得られたもの・得られなかったもの〜
ohnoeight
2
350
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
Can We Measure Developer Productivity?
ewolff
1
150
ノーコードデータ分析ツールで体験する時系列データ分析超入門
negi111111
0
410
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
120
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
Lambdaと地方とコミュニティ
miu_crescent
2
370
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
560
Security-JAWS【第35回】勉強会クラウドにおけるマルウェアやコンテンツ改ざんへの対策
4su_para
0
170
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
190
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
Ruby is Unlike a Banana
tanoku
97
11k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Producing Creativity
orderedlist
PRO
341
39k
Side Projects
sachag
452
42k
Designing the Hi-DPI Web
ddemaree
280
34k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Writing Fast Ruby
sferik
627
61k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Why Our Code Smells
bkeepers
PRO
334
57k
Thoughts on Productivity
jonyablonski
67
4.3k
Transcript
BUILDING FOR @andyhume SmashingConf, New York, 2014 PERFORMANCE RESILIENCE Tuesday,
June 17, 14
WHY CARE? http://www.strangeloopnetworks.com/resources/infographics/web-performance-and-ecommerce/ Tuesday, June 17, 14
WHY CARE? http://www.strangeloopnetworks.com/resources/infographics/web-performance-and-ecommerce/ Tuesday, June 17, 14
WHY CARE? http://www.strangeloopnetworks.com/resources/infographics/web-performance-and-ecommerce/ Tuesday, June 17, 14
WHY CARE? http://www.strangeloopnetworks.com/resources/infographics/web-performance-and-ecommerce/ Tuesday, June 17, 14
WHY CARE? http://www.strangeloopnetworks.com/resources/infographics/web-performance-and-ecommerce/ Tuesday, June 17, 14
WHY CARE? http://www.strangeloopnetworks.com/resources/infographics/web-performance-and-ecommerce/ Tuesday, June 17, 14
Measure http://www.flickr.com/photos/kayaker1204/4319542459/ Tuesday, June 17, 14
Measure http://www.flickr.com/photos/kayaker1204/4319542459/ We have a median page load me of
seven seconds, and our primary compe tor has a median page load me of three seconds. Tell a story Tuesday, June 17, 14
Measure http://www.flickr.com/photos/kayaker1204/4319542459/ Page load mes increased by 25% when we
added feature x. Tell a story Tuesday, June 17, 14
Your bosses love a story http://www.flickr.com/photos/kayaker1204/4319542459/ Tuesday, June 17, 14
Spread the word http://www.flickr.com/photos/kayaker1204/4319542459/ Tuesday, June 17, 14
What numbers?! http://www.flickr.com/photos/kayaker1204/4319542459/ Tuesday, June 17, 14
What numbers?! http://www.flickr.com/photos/kayaker1204/4319542459/ Page load time? Total download size? Start
render time? Time to first byte? Response time? Total HTTP requests? Document load time? Tuesday, June 17, 14
Tuesday, June 17, 14
Tuesday, June 17, 14
Tuesday, June 17, 14
Tuesday, June 17, 14
Tuesday, June 17, 14
Tuesday, June 17, 14
Tuesday, June 17, 14
Load Time First Byte Start Render Fully Loaded Speed Index
FIRST VIEW 3.783s 0.128s 0.676s 6.530s 1522 REPEAT VIEW 2.268s 0.486s 0.486s 3.617s 980 Tuesday, June 17, 14
Load Time First Byte Start Render Fully Loaded Speed Index
FIRST VIEW 3.783s 0.128s 0.676s 6.530s 1522 REPEAT VIEW 2.268s 0.486s 0.486s 3.617s 980 Tuesday, June 17, 14
Load Time First Byte Start Render Fully Loaded Speed Index
FIRST VIEW 3.783s 0.128s 0.676s 6.530s 1522 REPEAT VIEW 2.268s 0.486s 0.486s 3.617s 980 Tuesday, June 17, 14
Measure and tracking trends http://www.flickr.com/photos/kayaker1204/4319542459/ Tuesday, June 17, 14
SpeedCurve http://speedcurve.com Tuesday, June 17, 14
SpeedCurve http://speedcurve.com Tuesday, June 17, 14
How to optimize http://www.flickr.com/photos/freefoto/2231356418/ Tuesday, June 17, 14
Web performance 101 http://www.flickr.com/photos/freefoto/2231356418/ Content-Encoding: gzip Cache-Control: max-age=315360000 Tuesday, June
17, 14
Optimizing: First byte http://www.flickr.com/photos/freefoto/2231356418/ Load Time First Byte Start Render
Fully Loaded Speed Index FIRST VIEW 3.783s 0.128s 0.676s 6.530s 1522 REPEAT VIEW 2.268s 0.486s 0.486s 3.617s 980 Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp SSL Handshake Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp HTTP Redirect SSL Handshake Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp HTTP Redirect SSL Handshake Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp HTTP Redirect SSL Handshake Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp HTTP Redirect SSL Handshake Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp HTTP Redirect SSL Handshake Tuesday, June 17, 14
Eliminate redirects Just eleminate redirects Flush the document early? Prefetch
DNS? But really, just eleminate redirects Optimizing: First byte Tuesday, June 17, 14
Optimizing: Start render http://www.flickr.com/photos/freefoto/2231356418/ Load Time First Byte Start Render
Fully Loaded Speed Index FIRST VIEW 3.783s 0.128s 0.676s 6.530s 1522 REPEAT VIEW 2.268s 0.486s 0.486s 3.617s 980 Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Remote JS Optimizing: Start render HTML parser DOM tree Layout
Paint Render tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
inline script waiting on remote CSS Optimizing: Start render HTML
parser DOM tree Layout Paint Render tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree fetching remote stylesheets Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Avoid blocking scripts Optimizing: Start render Tuesday, June 17, 14
Optimizing: Start render <script> var script = document.createElement('script'); script.src =
"app.js"; document.head.appendChild(script); </script> Tuesday, June 17, 14
Optimizing: Start render <script> var script = document.createElement('script'); script.src =
"app.js"; document.head.appendChild(script); </script> BREAKS THE PRE-PARSER! Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree HTML pre- parser Tuesday, June 17, 14
Remote JS Optimizing: Start render HTML parser DOM tree Layout
Paint Render tree HTML pre- parser Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree HTML pre- parser Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree HTML pre- parser fetching remote stylesheets Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree HTML pre- parser Tuesday, June 17, 14
Optimizing: Start render <script> var script = document.createElement('script'); script.src =
"app.js"; document.head.appendChild(script); </script> BREAKS THE PRE-PARSER! Tuesday, June 17, 14
Optimizing: Start render <script src="app.js" async defer></script> Tuesday, June 17,
14
Avoid blocking scripts Optimizing: Start render Move script elements to
end of <body> Or... add async attribute to script elements Inline critical CSS Tuesday, June 17, 14
Avoid blocking scripts Optimizing: Start render Move script elements to
end of <body> Or... add async attribute to script elements Inline critical CSS https://github.com/pocketjoso/penthouse Tuesday, June 17, 14
Optimizing: Load time fully loaded http://www.flickr.com/photos/freefoto/2231356418/ Load Time First Byte
Start Render Fully Loaded Speed Index FIRST VIEW 3.783s 0.128s 0.676s 6.530s 1522 REPEAT VIEW 2.268s 0.486s 0.486s 3.617s 980 Tuesday, June 17, 14
gzip compression (of course!) Far-future caching (of course!) Concatenate files
(of course!) Optimizing: Load time fully loaded Tuesday, June 17, 14
Optimizing: Speed Index http://www.flickr.com/photos/freefoto/2231356418/ Load Time First Byte Start Render
Fully Loaded Speed Index FIRST VIEW 3.783s 0.128s 0.676s 6.530s 1522 REPEAT VIEW 2.268s 0.486s 0.486s 3.617s 980 Tuesday, June 17, 14
http://www.flickr.com/photos/vpickering/6824364286/ Resilience Tuesday, June 17, 14
http://www.flickr.com/photos/the_jorr/325224175/ Unreliable Tuesday, June 17, 14
http://www.flickr.com/photos/8040811@N06/3167877765 Progressive enhancement th Tuesday, June 17, 14
The future http://www.flickr.com/photos/kayaker1204/4319542459/ Tuesday, June 17, 14
Future: HTTP/2 SPDY Tuesday, June 17, 14
Future: HTTP/2 SPDY Multiplexing Cache pushing Tuesday, June 17, 14
Future: ServiceWorker Tuesday, June 17, 14
Future: ServiceWorker this.addEventListener('fetch', function (e) { if (e.request.url.host === 'guardian.co.uk')
{ e.forwardTo('http://theguardian.com'); } } (Possibly not possible) Tuesday, June 17, 14
Future: ServiceWorker this.addEventListener('fetch', function (e) { if (window.innerWidth > 500)
{ e.forwardTo(e.request.url + '?width=large'); } } (Possibly not possible) Tuesday, June 17, 14
Experiment and measure http://www.flickr.com/photos/kayaker1204/4319542459/ Tuesday, June 17, 14
Experiment and measure http://www.flickr.com/photos/kayaker1204/4319542459/ Theorize Experiment, and... Measure Tuesday, June
17, 14
Thank-you! http://lanyrd.com/sdbmhb @andyhume Creative Commons Licensed Attribution, Non-Commercial, Share Alike
cc Tuesday, June 17, 14