SlideShare una empresa de Scribd logo
1 de 47
Steve Souders [email_address] http://stevesouders.com/docs/web20expo-20090402.ppt Even Faster Web Sites Disclaimer:  This content does not necessarily reflect the opinions of my employer. Flushing the Document Early Simplifying CSS Selectors Avoiding @import
the importance of frontend performance 17% 83% iGoogle, primed cache 9% 91% iGoogle, empty cache
time spent on the frontend April 2008 Empty Cache Primed Cache www.aol.com 97% 97% www.ebay.com 95% 81% www.facebook.com 95% 81% www.google.com/search 47% 0% search.live.com/results 67% 0% www.msn.com 98% 94% www.myspace.com 98% 98% en.wikipedia.org/wiki 94% 91% www.yahoo.com 97% 96% www.youtube.com 98% 97%
14 RULES ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
 
 
Sept 2007
June 2009
Even Faster Web Sites Splitting the initial payload Loading scripts without blocking Coupling asynchronous scripts Positioning inline scripts Sharding dominant domains Flushing the document early Using iframes sparingly Simplifying CSS Selectors Understanding Ajax performance... Doug Crockford Creating responsive web apps...... Ben Galbraith, Dion Almaer Writing efficient JavaScript........... Nicholas Zakas Scaling with Comet...................... Dylan Schiemann Going beyond gzipping............... Tony Gentilcore Optimizing images..................... Stoyan Stefanov, Nicole Sullivan Avoiding @import
iframes:    most expensive DOM element ,[object Object],[object Object],1 IE 6, 7, 8; FF 2, 3.0, 3.1b2; Safari 3.2, 4; Opera 9.63, 10; Chrome 1.0, 2.0
iframes block onload ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
scripts block iframe ,[object Object],IE Firefox Safari Chrome Opera script script script
stylesheets block iframe (IE, FF) ,[object Object],IE Firefox Safari Chrome Opera stylesheet stylesheet stylesheet
stylesheets after iframe still block (FF) ,[object Object],IE Firefox Safari Chrome Opera stylesheet stylesheet stylesheet
iframes: no free connections ,[object Object],iframe parent
flushing the document early ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],call PHP's  flush() html image image script html image image script
flushing and domain blocking ,[object Object],case study: Google search blocked by HTML document different domains html image image script html image image script google image image script image 204
Simplifying CSS Selectors ,[object Object],combinator simple selectors selector declaration block rule
types of CSS selectors ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
types of CSS selectors ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
types of CSS selectors ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
writing efficient CSS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
writing efficient CSS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],https://developer.mozilla.org/en/Writing_Efficient_CSS
writing efficient CSS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],https://developer.mozilla.org/en/Writing_Efficient_CSS David Hyatt 4/21/2000
Testing CSS Performance ,[object Object],[object Object]
testing massive CSS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
CSS performance isn't linear ,[object Object]
real world levels of CSS # Rules # elements Avg Depth AOL 2289 1628 13 eBay 305 588 14 Facebook 2882 1966 17 Google Search 92 552 8 Live Search 376 449 12 MSN.com 1038 886 11 MySpace 932 444 9 Wikipedia 795 1333 10 Yahoo! 800 564 13 YouTube 821 817 9 average 1033 923 12
testing typical CSS  ,[object Object],[object Object],[object Object],1K rules (vs. 20K) same amount of CSS in all test pages 30 ms avg delta http://www.stevesouders.com/blog/2009/03/10/performance-impact-of-css-selectors/
testing expensive selectors 1K rules (vs. 20K) same amount of CSS in all test pages 2126 ms avg delta! ,[object Object],[object Object],[object Object],[object Object],[object Object]
CSS3 selectors (bad) ,[object Object],[object Object],[object Object]
selectors to avoid ,[object Object],[object Object],[object Object],[object Object]
reflow time vs. load time ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
reflow time by browser ,[object Object],[object Object],DHTML action Chr1 Chr2 FF2 FF3 IE6,7 IE 8 Op Saf3 Saf4 className 1x 1x 1x 1x 1x 1x 1x 1x 1x display none - - - - 1x - - - - display default 1x 1x 1x 2x 1x 1x - 1x 1x visibility hidden 1x 1x 1x 1x 1x 1x - 1x 1x visibility visible 1x 1x 1x 1x 1x 1x - 1x 1x padding - - 1x 2x 4x 4x - - - width length - - 1x 2x 1x 1x - 1x - width percent - - 1x 2x 1x 1x - 1x - width default 1x - 1x 2x 1x 1x - 1x - background - - 1x 1x 1x - - - - font-size 1x 1x 1x 2x 1x 1x - 1x 1x
Simplifying CSS Selectors ,[object Object],[object Object],[object Object]
Avoiding @import – @import @import ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],http://stevesouders.com/tests/atimport/import-import.php
link @import ,[object Object],[object Object],[object Object],[object Object],[object Object],http://stevesouders.com/tests/atimport/link-import.php
link with @import ,[object Object],[object Object],http://stevesouders.com/tests/atimport/link-with-import.php @import url('stylesheet2.css'); includes
link blocks @import ,[object Object],[object Object],[object Object],http://stevesouders.com/tests/atimport/link-blocks-import.php @import url('stylesheet2.css'); includes
many @imports ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],http://stevesouders.com/tests/atimport/many-imports.php
link link ,[object Object],[object Object],[object Object],http://stevesouders.com/tests/atimport/link-link.php
takeaways ,[object Object],[object Object],[object Object]
impact on revenue ,[object Object],[object Object],[object Object],1  http://home.blarg.net/~glinden/StanfordDataMining.2006-11-29.ppt 2  http://www.slideshare.net/stoyan/yslow-20-presentation +500 ms    -20% traffic 1 +400 ms    -5-9% full-page traffic 2 +100 ms    -1% sales 1
cost savings ,[object Object],[object Object],http://billwscott.com/share/presentations/2008/stanford/HPWP-RealWorld.pdf
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Steve Souders [email_address] http://stevesouders.com/docs/web20expo-20090402.ppt

Más contenido relacionado

La actualidad más candente

Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5dynamis
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行Sofish Lin
 
Rapid and Responsive - UX to Prototype with Bootstrap
Rapid and Responsive - UX to Prototype with BootstrapRapid and Responsive - UX to Prototype with Bootstrap
Rapid and Responsive - UX to Prototype with BootstrapJosh Jeffryes
 
Introduction to html 5
Introduction to html 5Introduction to html 5
Introduction to html 5Nir Elbaz
 
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Joseph Lewis
 
CSS pattern libraries
CSS pattern librariesCSS pattern libraries
CSS pattern librariesRuss Weakley
 
Web Typography with sIFR 3 at Drupalcamp Copenhagen
Web Typography with sIFR 3 at Drupalcamp CopenhagenWeb Typography with sIFR 3 at Drupalcamp Copenhagen
Web Typography with sIFR 3 at Drupalcamp CopenhagenMark Wubben
 
Is it time to start using HTML 5
Is it time to start using HTML 5Is it time to start using HTML 5
Is it time to start using HTML 5Ravi Raj
 
Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3Todd Zaki Warfel
 
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011Patrick Lauke
 
关于 Html5 那点事
关于 Html5 那点事关于 Html5 那点事
关于 Html5 那点事Sofish Lin
 
Browser Extensions for Web Hackers
Browser Extensions for Web HackersBrowser Extensions for Web Hackers
Browser Extensions for Web HackersMark Wubben
 
Bringing Typography to the Web with sIFR 3 at <head>
Bringing Typography to the Web with sIFR 3 at <head>Bringing Typography to the Web with sIFR 3 at <head>
Bringing Typography to the Web with sIFR 3 at <head>Mark Wubben
 
Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Estelle Weyl
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5Robert Nyman
 
Frontend Performance: Illusions & browser rendering
Frontend Performance: Illusions & browser renderingFrontend Performance: Illusions & browser rendering
Frontend Performance: Illusions & browser renderingManuel Garcia
 
HTML5 Introduction
HTML5 IntroductionHTML5 Introduction
HTML5 Introductiondynamis
 

La actualidad más candente (20)

Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5
 
HTML5 JS APIs
HTML5 JS APIsHTML5 JS APIs
HTML5 JS APIs
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行
 
Rapid and Responsive - UX to Prototype with Bootstrap
Rapid and Responsive - UX to Prototype with BootstrapRapid and Responsive - UX to Prototype with Bootstrap
Rapid and Responsive - UX to Prototype with Bootstrap
 
Introduction to html 5
Introduction to html 5Introduction to html 5
Introduction to html 5
 
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)
 
HTML5 Essentials
HTML5 EssentialsHTML5 Essentials
HTML5 Essentials
 
CSS pattern libraries
CSS pattern librariesCSS pattern libraries
CSS pattern libraries
 
Web Typography with sIFR 3 at Drupalcamp Copenhagen
Web Typography with sIFR 3 at Drupalcamp CopenhagenWeb Typography with sIFR 3 at Drupalcamp Copenhagen
Web Typography with sIFR 3 at Drupalcamp Copenhagen
 
Is it time to start using HTML 5
Is it time to start using HTML 5Is it time to start using HTML 5
Is it time to start using HTML 5
 
Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3
 
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011
 
关于 Html5 那点事
关于 Html5 那点事关于 Html5 那点事
关于 Html5 那点事
 
Browser Extensions for Web Hackers
Browser Extensions for Web HackersBrowser Extensions for Web Hackers
Browser Extensions for Web Hackers
 
Bringing Typography to the Web with sIFR 3 at <head>
Bringing Typography to the Web with sIFR 3 at <head>Bringing Typography to the Web with sIFR 3 at <head>
Bringing Typography to the Web with sIFR 3 at <head>
 
Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5
 
Css, xhtml, javascript
Css, xhtml, javascriptCss, xhtml, javascript
Css, xhtml, javascript
 
Frontend Performance: Illusions & browser rendering
Frontend Performance: Illusions & browser renderingFrontend Performance: Illusions & browser rendering
Frontend Performance: Illusions & browser rendering
 
HTML5 Introduction
HTML5 IntroductionHTML5 Introduction
HTML5 Introduction
 

Similar a Even faster web sites presentation 3

HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptraghavanp4
 
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.comA brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.comapplicake
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS MethodologyZohar Arad
 
Widget Summit 2008
Widget Summit 2008Widget Summit 2008
Widget Summit 2008Volkan Unsal
 
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1Heather Rock
 
Advance Css
Advance CssAdvance Css
Advance Cssvijayta
 
Advance Css 1194323118268797 5
Advance Css 1194323118268797 5Advance Css 1194323118268797 5
Advance Css 1194323118268797 5dharshyamal
 
Web performance essentials - Goodies
Web performance essentials - GoodiesWeb performance essentials - Goodies
Web performance essentials - GoodiesJerry Emmanuel
 
WordPress Development Confoo 2010
WordPress Development Confoo 2010WordPress Development Confoo 2010
WordPress Development Confoo 2010Brendan Sera-Shriar
 
Ease into HTML5 and CSS3
Ease into HTML5 and CSS3Ease into HTML5 and CSS3
Ease into HTML5 and CSS3Brian Moon
 
How do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML TricksHow do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML TricksCompare Infobase Limited
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrMichael Enslow
 
Ie9 dev overview (300) beta
Ie9 dev overview (300) betaIe9 dev overview (300) beta
Ie9 dev overview (300) betaKirk Yamamoto
 
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 201210 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 2012Bastian Grimm
 

Similar a Even faster web sites presentation 3 (20)

HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
Please dont touch-3.6-jsday
Please dont touch-3.6-jsdayPlease dont touch-3.6-jsday
Please dont touch-3.6-jsday
 
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.comA brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS Methodology
 
Widget Summit 2008
Widget Summit 2008Widget Summit 2008
Widget Summit 2008
 
Oscon 20080724
Oscon 20080724Oscon 20080724
Oscon 20080724
 
CSS Best practices
CSS Best practicesCSS Best practices
CSS Best practices
 
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1
 
Advance Css
Advance CssAdvance Css
Advance Css
 
Advance Css 1194323118268797 5
Advance Css 1194323118268797 5Advance Css 1194323118268797 5
Advance Css 1194323118268797 5
 
Using a CSS Framework
Using a CSS FrameworkUsing a CSS Framework
Using a CSS Framework
 
Web performance essentials - Goodies
Web performance essentials - GoodiesWeb performance essentials - Goodies
Web performance essentials - Goodies
 
WordPress Development Confoo 2010
WordPress Development Confoo 2010WordPress Development Confoo 2010
WordPress Development Confoo 2010
 
Ease into HTML5 and CSS3
Ease into HTML5 and CSS3Ease into HTML5 and CSS3
Ease into HTML5 and CSS3
 
How do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML TricksHow do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML Tricks
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking Modernizr
 
Ie9 dev overview (300) beta
Ie9 dev overview (300) betaIe9 dev overview (300) beta
Ie9 dev overview (300) beta
 
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 201210 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
 

Even faster web sites presentation 3

  • 1. Steve Souders [email_address] http://stevesouders.com/docs/web20expo-20090402.ppt Even Faster Web Sites Disclaimer: This content does not necessarily reflect the opinions of my employer. Flushing the Document Early Simplifying CSS Selectors Avoiding @import
  • 2. the importance of frontend performance 17% 83% iGoogle, primed cache 9% 91% iGoogle, empty cache
  • 3. time spent on the frontend April 2008 Empty Cache Primed Cache www.aol.com 97% 97% www.ebay.com 95% 81% www.facebook.com 95% 81% www.google.com/search 47% 0% search.live.com/results 67% 0% www.msn.com 98% 94% www.myspace.com 98% 98% en.wikipedia.org/wiki 94% 91% www.yahoo.com 97% 96% www.youtube.com 98% 97%
  • 4.
  • 5.  
  • 6.  
  • 7.  
  • 10. Even Faster Web Sites Splitting the initial payload Loading scripts without blocking Coupling asynchronous scripts Positioning inline scripts Sharding dominant domains Flushing the document early Using iframes sparingly Simplifying CSS Selectors Understanding Ajax performance... Doug Crockford Creating responsive web apps...... Ben Galbraith, Dion Almaer Writing efficient JavaScript........... Nicholas Zakas Scaling with Comet...................... Dylan Schiemann Going beyond gzipping............... Tony Gentilcore Optimizing images..................... Stoyan Stefanov, Nicole Sullivan Avoiding @import
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29. real world levels of CSS # Rules # elements Avg Depth AOL 2289 1628 13 eBay 305 588 14 Facebook 2882 1966 17 Google Search 92 552 8 Live Search 376 449 12 MSN.com 1038 886 11 MySpace 932 444 9 Wikipedia 795 1333 10 Yahoo! 800 564 13 YouTube 821 817 9 average 1033 923 12
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47. Steve Souders [email_address] http://stevesouders.com/docs/web20expo-20090402.ppt

Notas del editor

  1. Permission to use photo given by Amnemona: http://www.flickr.com/photos/marinacvinhal/379111290/
  2. Data source: Steve Souders Tested on IE6 on Comcast cable modem (~5 mbps) medium powered PC, April 2008.
  3. Ten top sites according to Alexa.com. Data source: Steve Souders Tested on IE6 on Comcast cable modem (~5 mbps) medium powered PC, April 2008. http://www.aol.com/ http://www.ebay.com/ http://www.facebook.com/ http://www.google.com/search?hl=en&amp;q=flowers http://www.myspace.com/ http://www.msn.com/ http://search.live.com/results.aspx?q=flowers&amp;mkt=en-us&amp;scope=&amp;FORM=LIVSOP http://en.wikipedia.org/wiki/Flowers http://www.yahoo.com/ http://www.youtube.com/ For Google and Live Search there are so few components (2-4) and they&apos;re mostly cacheable so the HTML document is a bigger percentage.
  4. photo courtesy of Vicki &amp; Chuck Rogers: http://www.flickr.com/photos/two-wrongs/205467442/
  5. reflow times measured in FF 3.0
  6. 72 years = 2,270,592,000 seconds = 500ms * 4.4B page views
  7. 72 years = 2,270,592,000 seconds = 500ms * 4.4B page views
  8. 72 years = 2,270,592,000 seconds = 500ms * 4.4B page views
  9. 72 years = 2,270,592,000 seconds = 500ms * 4.4B page views
  10. &amp;quot;thank you&amp;quot; by nj dodge: http://flickr.com/photos/nj_dodge/187190601/