SlideShare a Scribd company logo
1 of 19
Download to read offline
Google IO 2013
Web Performance Matters
Unispace 3D
Mitch
1
Google IO 2013 Sessions
Jank Free: Chrome Rendering Performance
True Grit: Debugging CSS & Render Performance
Web Page Design with the GPU in mind
Automating Performance Best Practices with PageSpeed
2
1. Focus on the user and all else will follow
2. It’s best to do one thing really, really well
3.Fast is better than slow
4. Democracy on the web works
5. You don’t need to be at your desk to need an answer
6. You can make money without doing evil
7. There’s always more information out there
8. The need for information crosses all borders
9. You can be serious without a suit
10.great just isn’t good enough
Google’s Ten Things
3
Freeing up the UI thread with
blisteringly-fast JS is key.
......but it’s not enough!
4
We need Fast Rendering!
5
Rendering Performance
Style recalculation
Layout (aka Reflow)
Paint
Composite
6
The Rendering Cycle
Build the DOM
Calculate CSS property values
Build the rendering tree
Calculate layout
Paint
Composite
7
The Rendering Cycle
Build the DOM
Calculate CSS property values
Build the rendering tree
Calculate layout
Paint
Composite
}Style Recalculation
}Layout
Painting
Compositing Layers
8
Rendering 101
Paint fast
Avoid accidental paints
Don’t paint at ALL
Eliminate layout
Minimize paint rectangles
Eliminate painting altogether
9
Visually complex CSS
Image decodes/resizes
Redundant large empty
layers
How to
position: fixed
overflow: scroll
hover effects
touch listeners
Unnecessary paints from:
Demo (hover effects)
Long paints from:
Demo (drag and drop)
10
How to
var newWidth = myDiv.offsetWidth+10; //Read
myDiv.style.width = newWidth+’px’; //Write
var newHeight = myDiv.offsetHeight+10; //Read
myDiv.style.height = newHeight+’px’; //Write
Unnecessary repaint & reflow:
11
How to
var newWidth = myDiv.offsetWidth+10; //Read
var newHeight = myDiv.offsetHeight+10; //Read
myDiv.style.width = newWidth+’px’; //Write
myDiv.style.height = newHeight+’px’; //Write
Better repaint & reflow:
12
How to
var div = document.getElementById(“box”);
lis = document.getElementByTagName(“li”);
i, len;
for(i=0; len=lis.length; i<len; i++) {
lis[i].style.width = div.offsetWidth+’px’;
}
Unnecessary repaint & reflow:
13
How to
var div = document.getElementById(“box”);
lis = document.getElementByTagName(“li”);
widthToSet = div.offsetWidth,
i, len;
for(i=0; len=lis.length; i<len; i++) {
lis[i].style.width = widthToSet+’px’;
}
Better repaint & reflow: Demo
14
Layers: Great for Animation
Want to animate with “no layout” and “no painting”
15
Layers
Painted independently, composited on the GPU
Can stretch, move, and fade without repainting
GPU + Layers = Faster Rendering
Too many layers = seriously bad time
Demo2Demo1
16
Hands-Free layer promotion
3D Transform
Canvas
Video
Plugins (i.e. Flash)
17
Use Dev Tools
Timeline
Show paint rectangles
Show composited layer borders
chrome://tracing
Continuous painting mode
PageSpeed (Chrome Extension)
18
Where to go from here
http://browserdiet.com/
http://coding.smashingmagazine.com/2012/11/05/
writing-fast-memory-efficient-javascript/
http://www.phpied.com/rendering-repaint-
reflowrelayout-restyle/
http://www.html5rocks.com/en/tutorials/speed/
layers/
http://updates.html5rocks.com/2013/02/Profiling-
19

More Related Content

Similar to Google IO 2013: Web Performance Matters

Mobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignMobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignCantina
 
Bootstrap Workout 2015
Bootstrap Workout 2015Bootstrap Workout 2015
Bootstrap Workout 2015Rob Davarnia
 
The future of BYU web design
The future of BYU web designThe future of BYU web design
The future of BYU web designNate Walton
 
Designing better user interfaces
Designing better user interfacesDesigning better user interfaces
Designing better user interfacesJohan Ronsse
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesVitaly Friedman
 
Progressive Enhancement
Progressive EnhancementProgressive Enhancement
Progressive EnhancementDan Sagisser
 
Accessible Javascript with and without WAI ARIA
Accessible Javascript with and without WAI ARIAAccessible Javascript with and without WAI ARIA
Accessible Javascript with and without WAI ARIADirk Ginader
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty grittyMario Noble
 
Building a game engine with jQuery
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQueryPaul Bakaus
 
2009_09_11_Grid960
2009_09_11_Grid9602009_09_11_Grid960
2009_09_11_Grid960LightSpeed
 
Responsive Design: Out of the Box and Down the Rabbit Hole
Responsive Design: Out of the Box and Down the Rabbit HoleResponsive Design: Out of the Box and Down the Rabbit Hole
Responsive Design: Out of the Box and Down the Rabbit HoleDan Moriarty
 
Fecc 12517-sd
Fecc 12517-sdFecc 12517-sd
Fecc 12517-sdThinkful
 
Advanced #2 - ui perf
 Advanced #2 - ui perf Advanced #2 - ui perf
Advanced #2 - ui perfVitali Pekelis
 
Teams, styles and scalable applications
Teams, styles and scalable applicationsTeams, styles and scalable applications
Teams, styles and scalable applicationsVittorio Vittori
 
Performance beyond page load - CSS Conf Asia 2015
Performance beyond page load - CSS Conf Asia 2015Performance beyond page load - CSS Conf Asia 2015
Performance beyond page load - CSS Conf Asia 2015Apoorv Saxena
 
Microsoft Webday 2008 - Silverlight Experiences
Microsoft Webday 2008 - Silverlight ExperiencesMicrosoft Webday 2008 - Silverlight Experiences
Microsoft Webday 2008 - Silverlight ExperiencesNicklas Andersson
 

Similar to Google IO 2013: Web Performance Matters (20)

Look ma! No images!
Look ma! No images!Look ma! No images!
Look ma! No images!
 
Mobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignMobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web Design
 
Bootstrap Workout 2015
Bootstrap Workout 2015Bootstrap Workout 2015
Bootstrap Workout 2015
 
The future of BYU web design
The future of BYU web designThe future of BYU web design
The future of BYU web design
 
Designing better user interfaces
Designing better user interfacesDesigning better user interfaces
Designing better user interfaces
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and Techniques
 
Activity 5
Activity 5Activity 5
Activity 5
 
Progressive Enhancement
Progressive EnhancementProgressive Enhancement
Progressive Enhancement
 
Accessible Javascript with and without WAI ARIA
Accessible Javascript with and without WAI ARIAAccessible Javascript with and without WAI ARIA
Accessible Javascript with and without WAI ARIA
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty gritty
 
Building a game engine with jQuery
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQuery
 
2009_09_11_Grid960
2009_09_11_Grid9602009_09_11_Grid960
2009_09_11_Grid960
 
Responsive Design: Out of the Box and Down the Rabbit Hole
Responsive Design: Out of the Box and Down the Rabbit HoleResponsive Design: Out of the Box and Down the Rabbit Hole
Responsive Design: Out of the Box and Down the Rabbit Hole
 
Fecc 12517-sd
Fecc 12517-sdFecc 12517-sd
Fecc 12517-sd
 
Designing with Code
Designing with CodeDesigning with Code
Designing with Code
 
Advanced #2 - ui perf
 Advanced #2 - ui perf Advanced #2 - ui perf
Advanced #2 - ui perf
 
Teams, styles and scalable applications
Teams, styles and scalable applicationsTeams, styles and scalable applications
Teams, styles and scalable applications
 
Performance beyond page load - CSS Conf Asia 2015
Performance beyond page load - CSS Conf Asia 2015Performance beyond page load - CSS Conf Asia 2015
Performance beyond page load - CSS Conf Asia 2015
 
Microsoft Webday 2008 - Silverlight Experiences
Microsoft Webday 2008 - Silverlight ExperiencesMicrosoft Webday 2008 - Silverlight Experiences
Microsoft Webday 2008 - Silverlight Experiences
 
Webdesign
WebdesignWebdesign
Webdesign
 

Recently uploaded

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 

Recently uploaded (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Google IO 2013: Web Performance Matters

  • 1. Google IO 2013 Web Performance Matters Unispace 3D Mitch 1
  • 2. Google IO 2013 Sessions Jank Free: Chrome Rendering Performance True Grit: Debugging CSS & Render Performance Web Page Design with the GPU in mind Automating Performance Best Practices with PageSpeed 2
  • 3. 1. Focus on the user and all else will follow 2. It’s best to do one thing really, really well 3.Fast is better than slow 4. Democracy on the web works 5. You don’t need to be at your desk to need an answer 6. You can make money without doing evil 7. There’s always more information out there 8. The need for information crosses all borders 9. You can be serious without a suit 10.great just isn’t good enough Google’s Ten Things 3
  • 4. Freeing up the UI thread with blisteringly-fast JS is key. ......but it’s not enough! 4
  • 5. We need Fast Rendering! 5
  • 6. Rendering Performance Style recalculation Layout (aka Reflow) Paint Composite 6
  • 7. The Rendering Cycle Build the DOM Calculate CSS property values Build the rendering tree Calculate layout Paint Composite 7
  • 8. The Rendering Cycle Build the DOM Calculate CSS property values Build the rendering tree Calculate layout Paint Composite }Style Recalculation }Layout Painting Compositing Layers 8
  • 9. Rendering 101 Paint fast Avoid accidental paints Don’t paint at ALL Eliminate layout Minimize paint rectangles Eliminate painting altogether 9
  • 10. Visually complex CSS Image decodes/resizes Redundant large empty layers How to position: fixed overflow: scroll hover effects touch listeners Unnecessary paints from: Demo (hover effects) Long paints from: Demo (drag and drop) 10
  • 11. How to var newWidth = myDiv.offsetWidth+10; //Read myDiv.style.width = newWidth+’px’; //Write var newHeight = myDiv.offsetHeight+10; //Read myDiv.style.height = newHeight+’px’; //Write Unnecessary repaint & reflow: 11
  • 12. How to var newWidth = myDiv.offsetWidth+10; //Read var newHeight = myDiv.offsetHeight+10; //Read myDiv.style.width = newWidth+’px’; //Write myDiv.style.height = newHeight+’px’; //Write Better repaint & reflow: 12
  • 13. How to var div = document.getElementById(“box”); lis = document.getElementByTagName(“li”); i, len; for(i=0; len=lis.length; i<len; i++) { lis[i].style.width = div.offsetWidth+’px’; } Unnecessary repaint & reflow: 13
  • 14. How to var div = document.getElementById(“box”); lis = document.getElementByTagName(“li”); widthToSet = div.offsetWidth, i, len; for(i=0; len=lis.length; i<len; i++) { lis[i].style.width = widthToSet+’px’; } Better repaint & reflow: Demo 14
  • 15. Layers: Great for Animation Want to animate with “no layout” and “no painting” 15
  • 16. Layers Painted independently, composited on the GPU Can stretch, move, and fade without repainting GPU + Layers = Faster Rendering Too many layers = seriously bad time Demo2Demo1 16
  • 17. Hands-Free layer promotion 3D Transform Canvas Video Plugins (i.e. Flash) 17
  • 18. Use Dev Tools Timeline Show paint rectangles Show composited layer borders chrome://tracing Continuous painting mode PageSpeed (Chrome Extension) 18
  • 19. Where to go from here http://browserdiet.com/ http://coding.smashingmagazine.com/2012/11/05/ writing-fast-memory-efficient-javascript/ http://www.phpied.com/rendering-repaint- reflowrelayout-restyle/ http://www.html5rocks.com/en/tutorials/speed/ layers/ http://updates.html5rocks.com/2013/02/Profiling- 19