SlideShare una empresa de Scribd logo
1 de 72
Descargar para leer sin conexión
Please Don’t Touch
      the Slow Parts V2
                         francesco.fullone@ideato.it
                             http://www.ideato.it/

                         federico.galassi@gmail.com
                          http://federico.galassi.net/

Saturday, May 15, 2010
Saturday, May 15, 2010
fast er

Saturday, May 15, 2010
fast er WEB

Saturday, May 15, 2010
Faster == Better?



Saturday, May 15, 2010
We have to wait



Saturday, May 15, 2010
... All the time



Saturday, May 15, 2010
“Savings in time
                     feels like simplicity”



Saturday, May 15, 2010
“Time is the only
 commodity that matters”



Saturday, May 15, 2010
Psychology of web
                  performance
                                                                                             5-8
                                                                                          SECONDS




             http://www.websiteoptimization.com/speed/tweak/psychology-web-performance/
Saturday, May 15, 2010
Faster web, more clicks




                 http://www.stevesouders.com/blog/2009/07/27/wikia-fast-pages-retain-users/
Saturday, May 15, 2010
Faster web, better SEO




http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html
Saturday, May 15, 2010
Faster web is hot




Saturday, May 15, 2010
Say web, Say browser




Saturday, May 15, 2010
How browsers work




Saturday, May 15, 2010
User clicks on a link




Saturday, May 15, 2010
Browser resolves
                           domain name                           DNS
                                           UDP

                                www.google.com




                                                 72.14.234.104




           domain

Saturday, May 15, 2010
Browser connects to
                 web server                        WEB
                                      TCP/IP

                                   72.14.234.104




           domain        connect

Saturday, May 15, 2010
Browser sends a
                         request for a page                            WEB
                                                    HTTP
                                           GET /language_tools?hl=en
                                           Host: www.google.com




           domain         connect   send

Saturday, May 15, 2010
Browser receives a
     response with the page                                WEB




                                                    HTTP

                                                200 OK




           domain        connect   send   receive

Saturday, May 15, 2010
Browser renders the
                 new page



           domain        connect   send   receive   render

Saturday, May 15, 2010
Rendering is complex
              parse + paint
                         render




Saturday, May 15, 2010
Rendering really complex
parse + paint + resources
                                                    render

                         css

                               css

                                     img

                                           img

                                            javascript

                                                   javascript

                                                         flash
Saturday, May 15, 2010
Each resource is another
         web request
                         render




Saturday, May 15, 2010
Requests are
                 processed in parallel
                          render




Saturday, May 15, 2010
Rendering is execution
                                 render



                              INPUT




                                          EVENT QUEUE

                                          mouse moved
                                          mouse pressed
                         OS               mouse released
                                          key pressed
                                          key released

Saturday, May 15, 2010
Execution in one thread
                           render


                         mouse moved EVENT QUEUE
                         mouse pressed
                         mouse released
                         key pressed
                         key released




           Javascript                                Web
           Execution                               Browsing

Saturday, May 15, 2010
Once upon a time...
                             Static pages
                             Few resources
                             Less javascript
Saturday, May 15, 2010
Most time on server
         domain connect   send   receive   render




Saturday, May 15, 2010
Solution is faster serverside
         domain connect   send   receive   render




Saturday, May 15, 2010
Ajax revolution




Saturday, May 15, 2010
perfo rmance
                         Ajax revolution




Saturday, May 15, 2010
Page updating
                              One time
                              (classic)   WEB




Saturday, May 15, 2010
Page updating
                             On demand
                               (ajax)         WEB




                              ... later ...




Saturday, May 15, 2010
Page updating
                             Continuous
                              (polling)   WEB




Saturday, May 15, 2010
Page updating
                                Push
                              (comet)    WEB




Saturday, May 15, 2010
Most time on browser
         domain connect   send   receive   render




Saturday, May 15, 2010
Golden rule of faster web
         80% of the end user
        response time is spent
           on the front-end

Saturday, May 15, 2010
Golden rule of faster web
                         Start there.



Saturday, May 15, 2010
Why web
                         slow parts?



Saturday, May 15, 2010
Easy to understand




Saturday, May 15, 2010
Each part has its rules




Saturday, May 15, 2010
Which parts are slow?




Saturday, May 15, 2010
Network is slow




Saturday, May 15, 2010
Less stuff
                         Fewer requests
                                  Too many resources



                                    Concatenate js/css
                                    Css sprites
                                    Inline images
Saturday, May 15, 2010
Less stuff
                         Cache requests
                                   Resources
                                   re-downloaded

                                   Expires header
                                   Revving Files
                                   External js/css
                                   Remove etags
Saturday, May 15, 2010
Smaller stuff
              Compress responses
                         Resources are too big



                             Content-Encoding
                             Gzip
                             Deflate
Saturday, May 15, 2010
Smaller stuff
                         Minify responses
                                  Resources are too big

                                       js, css, html
                                       remove formatting
                                       remove comments
                                       optimize images
                                       use tools
Saturday, May 15, 2010
Closer stuff
                         Use a CDN

                                 Resources are too far

                                       reduce latency



Saturday, May 15, 2010
Browser is slow




Saturday, May 15, 2010
Scripts block loading
                 html
                                                          document.write
                         javascript
                                                          location.href
                                         css
                                                          scripts order
                                         img

                                      javascript

                                                   img

                                                   flash

Saturday, May 15, 2010
Put scripts at bottom
                  html

                         css

                         img

                               img

                               flash

                                      javascript

                                                   javascript
Saturday, May 15, 2010
Unloaded styles
           block page rendering
                         html

                                img

                                img

                                flash

                                css




Saturday, May 15, 2010
Put styles at top
                         html

                                css

                                img

                                img

                                flash




Saturday, May 15, 2010
Indeed ... scripts block
              everything



Saturday, May 15, 2010
Load scripts
                         asynchronously
       var scriptTag = document.createElement("script")
       scriptTag.src = "http://www.example.org/js/lib.js"

       document.getElementsByTagName("head")[0]
               .appendChild(scriptTag)




Saturday, May 15, 2010
Yield with timers
             // doSomethingLong() is too slow, split it

             doSomething()

             setTimeout(function() {
                 doSomethingElse()
             }, 50)


Saturday, May 15, 2010
Scripts and styles
                            side effects

        dom is alive
        layout is alive



Saturday, May 15, 2010
Rules pitfalls




Saturday, May 15, 2010
Panta rei
                         Browserscope



                           http://www.browserscope.org/
Saturday, May 15, 2010
Expect the unexpected


                         empty cache
                         no compression




Saturday, May 15, 2010
Know your users
                     Track user capabilities




Saturday, May 15, 2010
Conflicting rules
                                   DNS vs Parallel
                                   Inline vs External
                                  Concatenated vs Reuse




Saturday, May 15, 2010
All that glitters
                           is not gold



Saturday, May 15, 2010
Everything is a
                            tradeoff



Saturday, May 15, 2010
performance brings
                    complexity



Saturday, May 15, 2010
know the rules but...




Saturday, May 15, 2010
leave complexity
                           to computers



Saturday, May 15, 2010
use libraries
              during development



Saturday, May 15, 2010
Use tools
                         at build time



Saturday, May 15, 2010
http://abetterbrowser.org/
Saturday, May 15, 2010
Questions?




Saturday, May 15, 2010

Más contenido relacionado

Destacado

Web Directions South - Even Faster Web Sites
Web Directions South - Even Faster Web SitesWeb Directions South - Even Faster Web Sites
Web Directions South - Even Faster Web Sites
Steve Souders
 
High Performance Mobile (SF/SV Web Perf)
High Performance Mobile (SF/SV Web Perf)High Performance Mobile (SF/SV Web Perf)
High Performance Mobile (SF/SV Web Perf)
Steve Souders
 
MongoDB Aug2010 SF Meetup
MongoDB Aug2010 SF MeetupMongoDB Aug2010 SF Meetup
MongoDB Aug2010 SF Meetup
Scott Hernandez
 
Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)
Jérôme Petazzoni
 

Destacado (13)

Cómo volarle la peluca a tus usuarios con la velocidad de tu sitio?
Cómo volarle la peluca a tus usuarios con la velocidad de tu sitio?Cómo volarle la peluca a tus usuarios con la velocidad de tu sitio?
Cómo volarle la peluca a tus usuarios con la velocidad de tu sitio?
 
Please Don't Touch the Slow Parts
Please Don't Touch the Slow PartsPlease Don't Touch the Slow Parts
Please Don't Touch the Slow Parts
 
PHP Kongress 2010 - Web-Performance
PHP Kongress 2010 - Web-PerformancePHP Kongress 2010 - Web-Performance
PHP Kongress 2010 - Web-Performance
 
Please Don't Touch the Slow Parts V3
Please Don't Touch the Slow Parts V3Please Don't Touch the Slow Parts V3
Please Don't Touch the Slow Parts V3
 
Web Directions South - Even Faster Web Sites
Web Directions South - Even Faster Web SitesWeb Directions South - Even Faster Web Sites
Web Directions South - Even Faster Web Sites
 
High Performance Mobile (SF/SV Web Perf)
High Performance Mobile (SF/SV Web Perf)High Performance Mobile (SF/SV Web Perf)
High Performance Mobile (SF/SV Web Perf)
 
MongoDB Aug2010 SF Meetup
MongoDB Aug2010 SF MeetupMongoDB Aug2010 SF Meetup
MongoDB Aug2010 SF Meetup
 
A/B Testing Framework Design
A/B Testing Framework DesignA/B Testing Framework Design
A/B Testing Framework Design
 
Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)
 
High Performance HTML5 (SF HTML5 UG)
High Performance HTML5 (SF HTML5 UG)High Performance HTML5 (SF HTML5 UG)
High Performance HTML5 (SF HTML5 UG)
 
Webinar slides: ClusterControl New Features Webinar
Webinar slides: ClusterControl New Features Webinar Webinar slides: ClusterControl New Features Webinar
Webinar slides: ClusterControl New Features Webinar
 
Canvas
CanvasCanvas
Canvas
 
Visual guide to selling software as a service by @prezly
Visual guide to selling software as a service by @prezlyVisual guide to selling software as a service by @prezly
Visual guide to selling software as a service by @prezly
 

Similar a Please Don't Touch the Slow Parts V2

The Art of the Spike
The Art of the SpikeThe Art of the Spike
The Art of the Spike
Aaron Bedra
 
Cutting Edge CSS3 @ WebExpo Tour 2010
Cutting Edge CSS3 @ WebExpo Tour 2010Cutting Edge CSS3 @ WebExpo Tour 2010
Cutting Edge CSS3 @ WebExpo Tour 2010
Zi Bin Cheah
 
Browsers & Web Technology - an Opera talk
Browsers & Web Technology - an Opera talkBrowsers & Web Technology - an Opera talk
Browsers & Web Technology - an Opera talk
Zi Bin Cheah
 
谈一谈HTML5/CSS3 @ WebRebuild 2010
谈一谈HTML5/CSS3 @ WebRebuild 2010谈一谈HTML5/CSS3 @ WebRebuild 2010
谈一谈HTML5/CSS3 @ WebRebuild 2010
Zi Bin Cheah
 
CrossMark Sneak Peek 2010 CrossRef Workshops
CrossMark Sneak Peek 2010 CrossRef WorkshopsCrossMark Sneak Peek 2010 CrossRef Workshops
CrossMark Sneak Peek 2010 CrossRef Workshops
Crossref
 

Similar a Please Don't Touch the Slow Parts V2 (20)

The Art of the Spike
The Art of the SpikeThe Art of the Spike
The Art of the Spike
 
Hardcore Extending Rails 3 - From RailsConf '10
Hardcore Extending Rails 3 - From RailsConf '10Hardcore Extending Rails 3 - From RailsConf '10
Hardcore Extending Rails 3 - From RailsConf '10
 
Refactoring
RefactoringRefactoring
Refactoring
 
Cutting Edge CSS3 @ WebExpo Tour 2010
Cutting Edge CSS3 @ WebExpo Tour 2010Cutting Edge CSS3 @ WebExpo Tour 2010
Cutting Edge CSS3 @ WebExpo Tour 2010
 
Mobile JavaScript Development - QCon 2010
Mobile JavaScript Development - QCon 2010Mobile JavaScript Development - QCon 2010
Mobile JavaScript Development - QCon 2010
 
Drupal In The Cloud
Drupal In The CloudDrupal In The Cloud
Drupal In The Cloud
 
Caelum dicas web 2010
Caelum dicas web 2010Caelum dicas web 2010
Caelum dicas web 2010
 
MySQL Sandbox - A toolkit for laziness
MySQL Sandbox - A toolkit for lazinessMySQL Sandbox - A toolkit for laziness
MySQL Sandbox - A toolkit for laziness
 
Real-Time Everything - the Era of Communication Ubiquity
Real-Time Everything - the Era of Communication UbiquityReal-Time Everything - the Era of Communication Ubiquity
Real-Time Everything - the Era of Communication Ubiquity
 
CSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp BostonCSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp Boston
 
Browsers & Web Technology - an Opera talk
Browsers & Web Technology - an Opera talkBrowsers & Web Technology - an Opera talk
Browsers & Web Technology - an Opera talk
 
Nick Sieger-Exploring Rails 3 Through Choices
Nick Sieger-Exploring Rails 3 Through Choices Nick Sieger-Exploring Rails 3 Through Choices
Nick Sieger-Exploring Rails 3 Through Choices
 
谈一谈HTML5/CSS3 @ WebRebuild 2010
谈一谈HTML5/CSS3 @ WebRebuild 2010谈一谈HTML5/CSS3 @ WebRebuild 2010
谈一谈HTML5/CSS3 @ WebRebuild 2010
 
Model-Driven Software Development - Web Abstractions 1
Model-Driven Software Development - Web Abstractions 1Model-Driven Software Development - Web Abstractions 1
Model-Driven Software Development - Web Abstractions 1
 
使用 PandaForm.com 製作及管理網上表格
使用 PandaForm.com 製作及管理網上表格使用 PandaForm.com 製作及管理網上表格
使用 PandaForm.com 製作及管理網上表格
 
CrossMark Sneak Peek 2010 CrossRef Workshops
CrossMark Sneak Peek 2010 CrossRef WorkshopsCrossMark Sneak Peek 2010 CrossRef Workshops
CrossMark Sneak Peek 2010 CrossRef Workshops
 
35+ Tools to Enhance Your Social Media Strategy
35+ Tools to Enhance Your Social Media Strategy35+ Tools to Enhance Your Social Media Strategy
35+ Tools to Enhance Your Social Media Strategy
 
Creating OpenSocial Apps
Creating OpenSocial AppsCreating OpenSocial Apps
Creating OpenSocial Apps
 
Layar event US introduction and cases
Layar event US introduction and casesLayar event US introduction and cases
Layar event US introduction and cases
 
Big Data loves JS
Big Data loves JSBig Data loves JS
Big Data loves JS
 

Más de Federico Galassi

Más de Federico Galassi (8)

Vim, the Way of the Keyboard
Vim, the Way of the KeyboardVim, the Way of the Keyboard
Vim, the Way of the Keyboard
 
The Strange World of Javascript and all its little Asynchronous Beasts
The Strange World of Javascript and all its little Asynchronous BeastsThe Strange World of Javascript and all its little Asynchronous Beasts
The Strange World of Javascript and all its little Asynchronous Beasts
 
Javascript the New Parts v2
Javascript the New Parts v2Javascript the New Parts v2
Javascript the New Parts v2
 
CouchApps: Requiem for Accidental Complexity
CouchApps: Requiem for Accidental ComplexityCouchApps: Requiem for Accidental Complexity
CouchApps: Requiem for Accidental Complexity
 
Javascript the New Parts
Javascript the New PartsJavascript the New Parts
Javascript the New Parts
 
Event Driven Javascript
Event Driven JavascriptEvent Driven Javascript
Event Driven Javascript
 
Javascript The Good Parts v2
Javascript The Good Parts v2Javascript The Good Parts v2
Javascript The Good Parts v2
 
Javascript The Good Parts
Javascript The Good PartsJavascript The Good Parts
Javascript The Good Parts
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
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...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Please Don't Touch the Slow Parts V2