SlideShare a Scribd company logo
1 of 98
Download to read offline
Building Faster 
(& Be!er) Sites 
Holger Bartel | @foobartel | FFCPH 8/11/2014
Performance is a thing.
Slow is Bad! 
Nobody likes to wait. Also not for your site to load.
Expectations 
Users expect sites to load in ~2-3 seconds…
Expectations 
Users expect sites to load in ~2-3 seconds… 
That’s the definition of ‘fast’ 
We’re even aiming to deliver something in even less
Expectations 
50% of people say they'll abandon a page that takes 
longer than 4 seconds to load
Expectations 
Depending on location and what the user is used to 
this might be slightly longer 
More than 6 seconds for sure is pushing it and people 
will leave
Faster is Be!er!
Faster is Be!er! 
Why?
The Real World 
(and why you should care)
40% of surveyed online shoppers will 
abandon a page that takes more than 3 
seconds to load. 
— Akamai (2009)
Speeding up a fundraising site by 60% 
increased donations by 14%. 
— Kyle Rush, Obama Campaign (2012)
Adding half a second to a search results 
page can decrease traffic and ad 
revenues by 20 percent 
— Google
Every additional 100 milliseconds of load time 
decreased sales by 1 percent. 
— Amazon
Global Network Speed
Global Broadband 
Download: 21.3Mbps 
Global Mobile: 
Download: 10.9Mbps 
http://www.netindex.com
Top 20 Countries Broadband Download 2012 - 2014 
http://www.netindex.com
November 2014 
Philippines 
Download: 3.49Mbps (Mobile roughly the same) 
Indonesia 
Download: 5.27Mbps (Mobile 2.67Mbps) 
USA 
Download: 31.3Mbps (Mobile 13.33Mbps) 
http://www.netindex.com
Too good to be true…?
3G, Edge, GPRS 
http://en.wikipedia.org/wiki/Intercity-Express#mediaviewer/File:SiemensVelaroD-InnoTrans2010.jpg
3G, Edge, GPRS, 
offline…
Faster is Be!er!
Progressive 
Enhancement
Because before thinking about making your 
site fast, we want to make sure it loads in the 
first place.
(Responsive) Web Design 
The idea of one web for everyone 
is one of our main goals. 
We just have to figure out how to best do it, 
so eventually it will work well for everybody.
2012 - 2014 
http://httparchive.org/interesting.php
RWD Lessons 
Working with the unknowns 
(Try to) Make the best assumptions
Assumptions 
We tried media queries & viewport sizes 
But: You could be mobile on Wifi or with a laptop 
tethering EDGE in the jungle 
How do we find out what our users want 
in their current environment?
Faster is Be!er!
Le!ing go… 
Just like we did with pixel-perfect design, we have to 
let go of the idea of the same experience for all 
browsers and all users.
…to progress 
Progressive Enhancement rather is about making 
core functionality available to everyone. 
Everything on top of that is the ‘enhancement’ part.
Every website is responsive from the start. 
Everything else on top of it, is how we 
brake the base feature. 
http://en.wikipedia.org/wiki/Tightrope_walking 
It’s easy!
It’s all here already.
Start simple and look at the bigger picture. 
Give users a great experience in its simplest form. 
Then progressively enhance to deliver be"er 
experiences.
Performance is Design
Performance is Design 
Design is Performance
Performance is Design 
Design is Performance 
Design directs Performance
“Performance is a compromise 
between design and performance. 
You can only be as fast as the 
design allows.” 
— Ian Feather
Breaking Silos 
Collaboration & communication between designers 
and developers nowadays is essential and more 
important than ever before.
Get designs into the browser as soon as 
possible, so you, your team and your client can 
get a be"er feel for what it will be like in the 
real world.
Ask yourself: 
What's the gain? 
What do you want to achieve?
A carousel with 7 images - 
is it really worth the load 
time or just pre"y to look 
at?
Whereas it's questionable 
if images 3-7 will be seen 
in the first place.
“If images would be render 
blocking we'd probably think 
twice about them.” 
— Jake Archibald
Performance Budgets 
http://timkadlec.com/2013/01/setting-a-performance-budget/
Building for 
Performance
Rendering Pages
Render-Tree Construction, 
Layout & Paint 
Waiting for DOM and CSSOM to build the render tree. 
Render tree contains nodes to render the page. 
Layout computes the exact position and size. 
Paint turns the render tree into pixels on screen.
Render Blocking CSS 
Waiting for CSS 
Avoids “Flash of Unstyled Content” (FOUC)
Render Blocking JavaScript 
The parser has to stop for scripts before continuing to parse 
HTML. 
JavaScript can query and modify DOM and CSSOM. 
JavaScript blocks DOM construction unless explicitly 
declared as async.
Loading JavaScript 
Every request fetched inside of HEAD, will postpone 
the rendering of the page
Limit HTTP Requests 
Every request takes roughly ~200ms 
Avoid unnecessary redirects
Critical Rendering 
Path 
Critical Resource 
Critical Path Length 
Critical Bytes
Optimising the Critical 
Rendering 
Path 
Optimizing the dependency graph between HTML, 
CSS, and JavaScript. 
https://developers.google.com/web/fundamentals/
Optimising the Critical 
Rendering 
Path 
= 
Ge!ing stuff on the 
screen fast
Navigation Timing API 
domLoading: this is the starting timestamp of the entire 
process - start parsing the first received bytes of the HTML 
document 
domContentLoaded: marks the point when both the DOM is 
ready and there are no stylesheets that are blocking 
JavaScript execution 
loadEvent: as a final step in every page load the browser 
fires an “onload” event
Without CSS & JS 
https://developers.google.com/web/fundamentals/
With CSS & JS 
https://developers.google.com/web/fundamentals/
To get stuff on the 
screen fast…
Minimize the number of critical resources. 
Minimize the number of critical bytes. 
Minimize the critical path length. 
A critical resource is a resource that can 
block initial rendering of a page.
Analyze and characterize: number of 
resources, bytes, length. 
Minimize number of critical resources. 
Optimize order of remaining critical resources 
being loaded: download critical assets as 
early as possible. 
Optimize the number of critical bytes to 
reduce the download time (number of 
roundtrips).
The low hanging fruit 
Put your JavaScript files at the bo"om 
Optimize your images 
Concatenate files 
Minimize files 
Far future expires headers for caching 
Google Page Speed 
YSlow
Perceived Performance 
Fastclick 
Polyfill to remove click delays on browsers with touch 
UIs
Taming Framework 
Overhead
Frameworks 
B
Kill The Lazy Developer In 
You 
It’s so easy to choose a framework like Bootstrap & 
plug in a li"le jQuery…
Don’t trade Performance 
for a Framework 
Do you really need all that stuff? 
No? 
Do something about it then!
CSS Spring Cleaning 
CSS SPRING CLEANING
Just Like With Other 
Stuff
Too Much Overhead: 
15.689 CSS rules
Missedin-HKG.com 
Built with Foundation 5 as an MVP 
Uses jQuery, jQuery UI, Vanilla JS 
& various Grunt tasks
Development 
CSS File Size: 88Kb 
JS File Size: 213Kb 
Production 
CSS File Size: 3.8Kb 
JS File Size: 54.3Kb
Tools
Code Guide 
Standards for developing flexible, durable, and 
sustainable HTML and CSS. 
http://mdo.github.io/code-guide/
Cross-Browser Testing 
VirtualBox 
Modern.ie 
Browserstack.com 
Sauce Labs
Device Testing 
Adobe Edge Inspect 
Ghostlab 
BrowserSync!
6 Weeks 
= 
428 Different Devices
http://opensignal.com/reports/2014/android-fragmentation/
Testing on Real Devices 
opendevicelab.com 
Photo: @viljamis http://devicelab.fi
Performance Testing 
http://www.webpagetest.org
Performance Testing 
http://tools.pingdom.com/fpt/ 
https://developers.google.com/speed/pagespeed/ 
https://developer.yahoo.com/yslow/
Chrome Dev Tools
Perf-Tooling Today 
http://perf-tooling.today
With achieving fast page load time, 
people can quickly use your site and 
accomplish what they want.
People will appreciate it and end up 
being happier users.
Happier users mean be!er 
conversion rates. 
Be!er conversion rates can be 
increased revenue, more signups, 
returning visits, or downloads.
So… 
Faster is Be!er!
Thanks! 
Holger Bartel | @foobartel | FFCPH 8/11/2014

More Related Content

More from Holger Bartel

Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015Holger Bartel
 
Building Better Responsive Websites
Building Better Responsive WebsitesBuilding Better Responsive Websites
Building Better Responsive WebsitesHolger Bartel
 
180 Degrees East, SmartDevCon 2013, Katowice, Poland
180 Degrees East, SmartDevCon 2013, Katowice, Poland180 Degrees East, SmartDevCon 2013, Katowice, Poland
180 Degrees East, SmartDevCon 2013, Katowice, PolandHolger Bartel
 
180 Degrees East, Webshaped 2013, Helsinki, Finland
180 Degrees East, Webshaped 2013, Helsinki, Finland180 Degrees East, Webshaped 2013, Helsinki, Finland
180 Degrees East, Webshaped 2013, Helsinki, FinlandHolger Bartel
 
180 Degrees East at Front Trends 2013, Warsaw, Poland
180 Degrees East at Front Trends 2013, Warsaw, Poland180 Degrees East at Front Trends 2013, Warsaw, Poland
180 Degrees East at Front Trends 2013, Warsaw, PolandHolger Bartel
 
Open Device Labs for A Better User Experience (Mobilliance, Hong Kong)
Open Device Labs for A Better User Experience (Mobilliance, Hong Kong)Open Device Labs for A Better User Experience (Mobilliance, Hong Kong)
Open Device Labs for A Better User Experience (Mobilliance, Hong Kong)Holger Bartel
 
Responsive Web Design & Workflows for Todays Web (THE UX-MEN at The Hive, Hon...
Responsive Web Design & Workflows for Todays Web (THE UX-MEN at The Hive, Hon...Responsive Web Design & Workflows for Todays Web (THE UX-MEN at The Hive, Hon...
Responsive Web Design & Workflows for Todays Web (THE UX-MEN at The Hive, Hon...Holger Bartel
 

More from Holger Bartel (7)

Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015
 
Building Better Responsive Websites
Building Better Responsive WebsitesBuilding Better Responsive Websites
Building Better Responsive Websites
 
180 Degrees East, SmartDevCon 2013, Katowice, Poland
180 Degrees East, SmartDevCon 2013, Katowice, Poland180 Degrees East, SmartDevCon 2013, Katowice, Poland
180 Degrees East, SmartDevCon 2013, Katowice, Poland
 
180 Degrees East, Webshaped 2013, Helsinki, Finland
180 Degrees East, Webshaped 2013, Helsinki, Finland180 Degrees East, Webshaped 2013, Helsinki, Finland
180 Degrees East, Webshaped 2013, Helsinki, Finland
 
180 Degrees East at Front Trends 2013, Warsaw, Poland
180 Degrees East at Front Trends 2013, Warsaw, Poland180 Degrees East at Front Trends 2013, Warsaw, Poland
180 Degrees East at Front Trends 2013, Warsaw, Poland
 
Open Device Labs for A Better User Experience (Mobilliance, Hong Kong)
Open Device Labs for A Better User Experience (Mobilliance, Hong Kong)Open Device Labs for A Better User Experience (Mobilliance, Hong Kong)
Open Device Labs for A Better User Experience (Mobilliance, Hong Kong)
 
Responsive Web Design & Workflows for Todays Web (THE UX-MEN at The Hive, Hon...
Responsive Web Design & Workflows for Todays Web (THE UX-MEN at The Hive, Hon...Responsive Web Design & Workflows for Todays Web (THE UX-MEN at The Hive, Hon...
Responsive Web Design & Workflows for Todays Web (THE UX-MEN at The Hive, Hon...
 

Recently uploaded

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Recently uploaded (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Building Faster and Better Sites – Form, Function, Class Conference, Manila, Nov 8, 2014