SlideShare a Scribd company logo
IT WORKS ON YOUR COMPUTER
BUTDOESITRENDERFASTENOUGH?
WHO AM I?
Diogo Antunes
infrastructure team @ Booking.com
client side performance improvement/optimization
@dicode
OVERVIEW
how browsers render?
browsers
tips
tools/services
HOW DO BROWSERS DO THEIR JOB?
ARCHITECTURE
RENDERING
PARSING FLOW
WANT TO GO DEEPER?
http://taligarsiel.com/Projects/howbrowserswork1.htm
BACK TO THE BROWSERS!
CHROME
layout engine - webkit
js engine - v8
FIREFOX
layout engine - gecko
js engine - JägerMonkey (since 4.0)
SAFARI
layout engine - webkit
js engine - Nitro
INTERNET EXPLORER
layout engine - trident (since 4.0)
js engine - Chakra (since 9), JScript before
OPERA
layout engine - presto (since 7.0)
js engine - Carakan (since 10.50)
WHAT ARE WE TALKING ABOUT?
Repaint
Reflow
JS rendering time
REPAINT
changes that affect visibility of the element
but not the layout
eg. opacity, background-color
REPAINT
it's expensive
so avoid inline css/js
eg. opacity, background-color
REFLOW
changes that affect viewport/elements size
may be as expensive as laying out the whole page again
problem is many things trigger this event
VISUALIZING REFLOW
mozilla.org
Gecko  Reflow  Visualization  -­  mozilla.org
VISUALIZING REFLOW
google.co.jp
Gecko  Reflow  Visualization  -­  google.co.jp
VISUALIZING REFLOW
wikipedia
Gecko  Reflow  Visualization  -­  Wikipedia
REFLOW
even more expensive than a repaint
can be triggered by many actions
so avoid inline css/js
and even a offsetWidth/Height calculation triggers it
JS RENDERING TIME
the model of the web is synchronous
when a script tag appears, it will parse and execute the script
in FF and Webkit another thread continues to parse the HTML doc
JS RENDERING TIME
it can lock your rendering
it can also produce repaint/reflow
which means it will take longer to execute
LET'S LOOK AT THE WATERFALLS
It works on your computer... but does it render fast enough?
CHROME
Yahoo
Wumocomicstrip
FF
Yahoo
Wumocomicstrip
IE 9
Yahoo
Wumocomicstrip
IE 8
Yahoo
Wumocomicstrip
IE 7
Yahoo
Wumocomicstrip
BEWARE
number of concurrent connections
css limits IE6-9
choose wisely when to run your JS
BEWARE PARALLEL CONNECTIONS
IE 6-7: 2
IE 8-9: 6
Chrome, Firefox, Safari: 6
You can change this, but you don't want that
It works on your computer... but does it render fast enough?
CSS
Bad selectors bad *
avoid css expressions
put css in the document head
JS
scripts @ bottom
async, defer, lazy load
beware of the DOM
micro optimization - really the last thing you should do
HTML
specify a charset
keep the number of DOM nodes as low as possible
avoid massive depth
IMAGES
set width and height
crop extra space around images
use the best file format
eg. use png-8, gif to reduce the number of colors in the pallette
HTTP
Use gzip where possible
reduce dns lookups
use cookieless domains for static content
use a CDN
avoid redirects
FRONTEND SPOF
any 3rd party widget
custom font downloading
even your own JS can cause it...
wumocomicstrip.com
MOBILE
Mobile IS different!
then again not that different
SAFARI MOBILE (IOS)
layout engine - webkit
js engine - Nitro
CHROME MOBILE (ANDROID)
layout engine - webkit
js engine - v8
in iOS it uses a UI Webview
FIREFOX MOBILE (ANDROID)
layout engine - gecko
js engine - JägerMonkey (since 4.0)
WATTERFALLS AGAIN
YAHOO IPAD2
http://mobitest.akamai.com/m/results.cgi?testid=121112_XA_4T
YAHOO GALAXY S, ANDROID 2.2
http://mobitest.akamai.com/m/results.cgi?testid=121112_3S_6J
YAHOO IPHONE 4, IOS 5
http://mobitest.akamai.com/m/results.cgi?testid=121112_HM_6K
ADDITIONAL ISSUES
latency
battery life
number of requests
data transfer size
TIPS
use data-uri for images wisely
HTML 5 api
W3C Mobile best practices
TOOLS
CHROME TOOLS
Chrome dev tools
CHROME TOOLS
speed tracer
It works on your computer... but does it render fast enough?
It works on your computer... but does it render fast enough?
FF TOOLS
FF dev tools
FF TOOLS
Firebug
OPERA TOOLS
Opera Dragonfly
IE TOOLS
Ajax Dynatrace
CROSS BROWSER
webpagetest.org
DATA FTW
TRACK YOUR LOAD TIMES
custom
navigation timing api
harstorage.com
TRACK YOUR JS ERRORS
window.onerror
http://errorception.com/
WEBPERF INSIGHTS
google page speed
google page service
yslow
PROFILE AND BENCHMARK YOUR JS
js perf
profilers in the dev tools
TRACK LATENCY
https://github.com/yahoo/boomerang
WHAT BROWSERS SHOULD I REALLY CARE ABOUT?
here comes the silver bullet!!!
it really.... depends
get to know your audience!
STATCOUNTER
W3SCHOOLS
NET APPLICATIONS
W3COUNTER
AKAMAI IO
BUILD YOUR FRONTEND CODE WISELY!
some flexibility may be lost
follow the principles
but addapt them to your business customers/needs
THANKS!
Q & A
RESOURCES
http://taligarsiel.com/Projects/howbrowserswork1.htm
https://developers.google.com/speed/docs/best-
practices/rules_intro
http://www.stevesouders.com/
http://www.w3.org/TR/mobile-bp/
http://developer.yahoo.com/performance/rules.html
http://www.stubbornella.org/content/2009/03/27/reflows-
repaints-css-performance-making-your-javascript-slow/
BOOKS
High Performance Web Sites
Web Performance Daybook Volume 2
Even Faster Web Sites
It works on your computer... but does it render fast enough?

More Related Content

PPTX
Blazor and azure functions for serverless websites
PPTX
Implementando rapidamente web apps com blazor e serverless
PPTX
Blazor
PDF
High performance web server
PDF
Opera and the Open Web platform
PPTX
Introduction to node.js
PPT
Jsdc 2013
PPTX
DevPira2019 - Blazor
Blazor and azure functions for serverless websites
Implementando rapidamente web apps com blazor e serverless
Blazor
High performance web server
Opera and the Open Web platform
Introduction to node.js
Jsdc 2013
DevPira2019 - Blazor

What's hot (20)

PDF
CCSP 2012F 早點下班的工具
ODP
Web Design And Development With Open Source
KEY
FMCakeMixってウマいの?
PDF
Responsive Web Design
PDF
Crafting Awesome Designs - #BSW14
PDF
Tips and tricks for using wordpress as application platform.
PPT
How to use CommonJS and AMD Modules now and in the browser!
PPTX
Codificando Night Week - Blazor, tornando o fullstack C# possível!
PDF
Don't touch the mobile parts
PDF
Koubei banquet 35
PPTX
Responsive browser-based video recording and playback
PPT
Word Camp Kansai 2014 - MVC Framework
ODP
Making Chrome Extension with AngularJS
PDF
Bruce Lawson, Web Development 2.0, SparkUp! Poznan Poland
PDF
Bruce lawson-over-the-air
PDF
Why Open Web Standards are cool and will save the world. Or the Web, at least.
ODP
Android Programming Basics - Simple Pizza Delivery Application
PPTX
Dev week2019 blazor
PDF
Nguyễn hữu bình
PPTX
Ansible Configuring Windows
CCSP 2012F 早點下班的工具
Web Design And Development With Open Source
FMCakeMixってウマいの?
Responsive Web Design
Crafting Awesome Designs - #BSW14
Tips and tricks for using wordpress as application platform.
How to use CommonJS and AMD Modules now and in the browser!
Codificando Night Week - Blazor, tornando o fullstack C# possível!
Don't touch the mobile parts
Koubei banquet 35
Responsive browser-based video recording and playback
Word Camp Kansai 2014 - MVC Framework
Making Chrome Extension with AngularJS
Bruce Lawson, Web Development 2.0, SparkUp! Poznan Poland
Bruce lawson-over-the-air
Why Open Web Standards are cool and will save the world. Or the Web, at least.
Android Programming Basics - Simple Pizza Delivery Application
Dev week2019 blazor
Nguyễn hữu bình
Ansible Configuring Windows
Ad

Viewers also liked (6)

PDF
PDF
Debugging your JavaScript
PDF
Pocket Knife JS
PPTX
Cq5 for enterprises: content delivery strategies
PDF
Know your errors
PDF
Making burgers with JavaScript
Debugging your JavaScript
Pocket Knife JS
Cq5 for enterprises: content delivery strategies
Know your errors
Making burgers with JavaScript
Ad

Similar to It works on your computer... but does it render fast enough? (20)

PDF
Tuning web performance
PDF
Tuning Web Performance
PDF
TRWResume-10-2016
PDF
Angular js mobile jsday 2014 - Verona 14 may
PDF
micro-frontends-with-vuejs
PDF
Catching-up web technologies - an endless story
PPTX
Normalizing x pages web development
PDF
Past, present, and future of web assembly - Devfest Nantes 2017
PPTX
Android crash course
PDF
Profiling PHP with Xdebug / Webgrind
PDF
The Happy Path: Migration Strategies for Node.js
PDF
mobicon_paper
PDF
Android Starter Kit
PPTX
Welcome to Blazor
PDF
[convergese] Adaptive Images in Responsive Web Design
PDF
Use Web Skills To Build Mobile Apps
PPTX
Basic html5 and javascript
PDF
HTML5 Intoduction for Web Developers
PDF
Intro to mobile web application development
PDF
soft-shake.ch - Introduction to HTML5
Tuning web performance
Tuning Web Performance
TRWResume-10-2016
Angular js mobile jsday 2014 - Verona 14 may
micro-frontends-with-vuejs
Catching-up web technologies - an endless story
Normalizing x pages web development
Past, present, and future of web assembly - Devfest Nantes 2017
Android crash course
Profiling PHP with Xdebug / Webgrind
The Happy Path: Migration Strategies for Node.js
mobicon_paper
Android Starter Kit
Welcome to Blazor
[convergese] Adaptive Images in Responsive Web Design
Use Web Skills To Build Mobile Apps
Basic html5 and javascript
HTML5 Intoduction for Web Developers
Intro to mobile web application development
soft-shake.ch - Introduction to HTML5

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Cloud computing and distributed systems.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Spectroscopy.pptx food analysis technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Empathic Computing: Creating Shared Understanding
Unlocking AI with Model Context Protocol (MCP)
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Cloud computing and distributed systems.
NewMind AI Weekly Chronicles - August'25 Week I
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Digital-Transformation-Roadmap-for-Companies.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Dropbox Q2 2025 Financial Results & Investor Presentation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Programs and apps: productivity, graphics, security and other tools
Spectroscopy.pptx food analysis technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The AUB Centre for AI in Media Proposal.docx
Chapter 3 Spatial Domain Image Processing.pdf

It works on your computer... but does it render fast enough?