SlideShare a Scribd company logo
1 of 56
Download to read offline
Magic, Illusion and other Peformances
                            Bandwidth
                               Latency
                                 Tools




              Websites on Overdrive

   Philip Tellis / philip@bluesmoon.info


              WebDU 2010 / 6-7 May 2010




         WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                       Bandwidth
                                          Latency
                                            Tools


$ finger philip



      Philip Tellis
      philip@bluesmoon.info
      @bluesmoon
      yahoo
      geek
      http://bluesmoon.info/




                    WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                         Seeing is believing
                            Bandwidth
                                         The cost of performance
                               Latency
                                         Where should we concentrate?
                                 Tools




     Magic, Illusion and other Performances




         WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                   Seeing is believing
                                      Bandwidth
                                                   The cost of performance
                                         Latency
                                                   Where should we concentrate?
                                           Tools


User perception




    How fast does the user think it takes
    your page to load?
        Do you want a really fast page that
        appears to be slow?
        or do you want a slow page that
        appears to be fast?




                   WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                   Seeing is believing
                                      Bandwidth
                                                   The cost of performance
                                         Latency
                                                   Where should we concentrate?
                                           Tools


User perception




    How fast does the user think it takes
    your page to load?
        Do you want a really fast page that
        appears to be slow?
        or do you want a slow page that
        appears to be fast?




                   WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                   Seeing is believing
                                      Bandwidth
                                                   The cost of performance
                                         Latency
                                                   Where should we concentrate?
                                           Tools


User perception




    How fast does the user think it takes
    your page to load?
        Do you want a really fast page that
        appears to be slow?
        or do you want a slow page that
        appears to be fast?




                   WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  Seeing is believing
                                     Bandwidth
                                                  The cost of performance
                                        Latency
                                                  Where should we concentrate?
                                          Tools


Blink




    How many blinks between click and
    onload?
        The average human eye takes
        300-400ms to blink
        Web search results (Google & Yahoo!)
        load in about 3 blinks




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  Seeing is believing
                                     Bandwidth
                                                  The cost of performance
                                        Latency
                                                  Where should we concentrate?
                                          Tools


Blink




    How many blinks between click and
    onload?
        The average human eye takes
        300-400ms to blink
        Web search results (Google & Yahoo!)
        load in about 3 blinks




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  Seeing is believing
                                     Bandwidth
                                                  The cost of performance
                                        Latency
                                                  Where should we concentrate?
                                          Tools


Blink




    How many blinks between click and
    onload?
        The average human eye takes
        300-400ms to blink
        Web search results (Google & Yahoo!)
        load in about 3 blinks




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                 Seeing is believing
                                    Bandwidth
                                                 The cost of performance
                                       Latency
                                                 Where should we concentrate?
                                         Tools


Games




                  Double-buffering and the VBLANK




                 WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                          Seeing is believing
                                             Bandwidth
                                                          The cost of performance
                                                Latency
                                                          Where should we concentrate?
                                                  Tools


How expensive is that blink?


         Yahoo! – 400ms slower → 5-9% drop in full page loads
         Google – 400ms slower → search engagement reduces
         over time
         Bing – 1 sec slower → 2.8% revenue drop,
         2 sec slower → 4.3% drop



  Ref: The business of performance – Stoyan Stefanov




                          WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                          Seeing is believing
                                             Bandwidth
                                                          The cost of performance
                                                Latency
                                                          Where should we concentrate?
                                                  Tools


... and conversely


         Shopzilla – 6s → 1.2s resulted in 7-12% increase in
         conversion rate
         Netflix – 43% decrease in bandwidth bill after enabling
         compression
         What about You?



  Ref: The business of performance – Stoyan Stefanov




                          WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                          Seeing is believing
                                             Bandwidth
                                                          The cost of performance
                                                Latency
                                                          Where should we concentrate?
                                                  Tools


... and conversely


         Shopzilla – 6s → 1.2s resulted in 7-12% increase in
         conversion rate
         Netflix – 43% decrease in bandwidth bill after enabling
         compression
         What about You?



  Ref: The business of performance – Stoyan Stefanov




                          WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  Seeing is believing
                                     Bandwidth
                                                  The cost of performance
                                        Latency
                                                  Where should we concentrate?
                                          Tools


The wheels behind the screen




     Performance improvement boils down to two things
         Bandwidth
         Latency
     Do you need to take the bus or a motorcycle?




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  Seeing is believing
                                     Bandwidth
                                                  The cost of performance
                                        Latency
                                                  Where should we concentrate?
                                          Tools


The wheels behind the screen




     Performance improvement boils down to two things
         Bandwidth
         Latency
     Do you need to take the bus or a motorcycle?




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  Seeing is believing
                                     Bandwidth
                                                  The cost of performance
                                        Latency
                                                  Where should we concentrate?
                                          Tools


The wheels behind the screen




     Performance improvement boils down to two things
         Bandwidth
         Latency
     Do you need to take the bus or a motorcycle?




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  Seeing is believing
                                     Bandwidth
                                                  The cost of performance
                                        Latency
                                                  Where should we concentrate?
                                          Tools


The wheels behind the screen




     Performance improvement boils down to two things
         Bandwidth
         Latency
     Do you need to take the bus or a motorcycle?




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                   Seeing is believing
                                      Bandwidth
                                                   The cost of performance
                                         Latency
                                                   Where should we concentrate?
                                           Tools


Not just the network




     Not just the network, but also within the browser process




                   WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                         The easier of the two
                            Bandwidth
                                         State of the internet
                               Latency
                                         How do we fix it?
                                 Tools




                               Bandwidth




         WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                         The easier of the two
                                            Bandwidth
                                                         State of the internet
                                               Latency
                                                         How do we fix it?
                                                 Tools


How fat is your pipe?



         How much data can you get across at once?
                Telephone system built for p-t-p voice?
                Optical fibre network?
                Geoff speeding down the M5 with 50TB of Daemon’s
                backup tapes?




  Ref: Shannon’s Theorem




                           WebDU 2010 / 6-7 May 2010     Websites on Overdrive
Magic, Illusion and other Peformances
                                                         The easier of the two
                                            Bandwidth
                                                         State of the internet
                                               Latency
                                                         How do we fix it?
                                                 Tools


How fat is your pipe?



         How much data can you get across at once?
                Telephone system built for p-t-p voice?
                Optical fibre network?
                Geoff speeding down the M5 with 50TB of Daemon’s
                backup tapes?




  Ref: Shannon’s Theorem




                           WebDU 2010 / 6-7 May 2010     Websites on Overdrive
Magic, Illusion and other Peformances
                                                         The easier of the two
                                            Bandwidth
                                                         State of the internet
                                               Latency
                                                         How do we fix it?
                                                 Tools


How fat is your pipe?



         How much data can you get across at once?
                Telephone system built for p-t-p voice?
                Optical fibre network?
                Geoff speeding down the M5 with 50TB of Daemon’s
                backup tapes?




  Ref: Shannon’s Theorem




                           WebDU 2010 / 6-7 May 2010     Websites on Overdrive
Magic, Illusion and other Peformances
                                                         The easier of the two
                                            Bandwidth
                                                         State of the internet
                                               Latency
                                                         How do we fix it?
                                                 Tools


How fat is your pipe?



         How much data can you get across at once?
                Telephone system built for p-t-p voice?
                Optical fibre network?
                Geoff speeding down the M5 with 50TB of Daemon’s
                backup tapes?




  Ref: Shannon’s Theorem




                           WebDU 2010 / 6-7 May 2010     Websites on Overdrive
Magic, Illusion and other Peformances
                                                    The easier of the two
                                       Bandwidth
                                                    State of the internet
                                          Latency
                                                    How do we fix it?
                                            Tools


Shannon’s Theorem




                                                              S
                                C = B × log2 (1 +               )
                                                              N


  C – Channel capacity in bps
  B – Bandwidth in Hz
  S – Signal strength
  N – Noise strength – S/N measured in dB



                    WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  The easier of the two
                                     Bandwidth
                                                  State of the internet
                                        Latency
                                                  How do we fix it?
                                          Tools


Bandwidth can be bought




     Bandwidth has increased steadily over time
     Networks, hard drives, memory, CPU, system bus,
     everything.
     Bandwidth can be parallelised




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                 The easier of the two
                                    Bandwidth
                                                 State of the internet
                                       Latency
                                                 How do we fix it?
                                         Tools


Bandwidth sells




                          Marketing loves a fat pipe




                 WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  The easier of the two
                                     Bandwidth
                                                  State of the internet
                                        Latency
                                                  How do we fix it?
                                          Tools


How fast is the internet?

  YUI Blog measured bandwidth at 1Mbps and latency of 262ms




                                                        Ref: Analysing Bandwidth & Latency – YUI Blog




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                           The easier of the two
                                              Bandwidth
                                                           State of the internet
                                                 Latency
                                                           How do we fix it?
                                                   Tools


How fast is the internet?




        Akamai measured average global bandwidth at 1.7Mbps




  Ref: State of the Internet – Akamai




                           WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                The easier of the two
                                   Bandwidth
                                                State of the internet
                                      Latency
                                                How do we fix it?
                                        Tools


ISPs




                WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                              The easier of the two
                                             Bandwidth
                                                              State of the internet
                                                Latency
                                                              How do we fix it?
                                                  Tools


Australian ISPs




  Keep in mind that the Internet latency from Australia to the US is about 280ms




                          WebDU 2010 / 6-7 May 2010           Websites on Overdrive
Magic, Illusion and other Peformances
                                                   The easier of the two
                                      Bandwidth
                                                   State of the internet
                                         Latency
                                                   How do we fix it?
                                           Tools


Pay for infrastructure




      South Korea invested in high bandwidth internet
      Google is investing in WiFi and Fibre in the US
      Akamai puts CDNs on high speed networks near the user




                   WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  The easier of the two
                                     Bandwidth
                                                  State of the internet
                                        Latency
                                                  How do we fix it?
                                          Tools


Measure your user’s bandwidth




   Javascript code to measure your user’s bandwidth & latency
                          bw-test v1.3




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  The easier of the two
                                     Bandwidth
                                                  State of the internet
                                        Latency
                                                  How do we fix it?
                                          Tools


Make more efficient use of bandwidth




     gzip all text over the network
     minify your HTML, Javascript and CSS
     smush your images




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                          The easier of the two
                                             Bandwidth
                                                          State of the internet
                                                Latency
                                                          How do we fix it?
                                                  Tools


Caveat about gzipping




               15% of users still get uncompressed responses




  Ref: Beyond Gzipping – Tony Gentilcore, Google




                          WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  The easier of the two
                                     Bandwidth
                                                  State of the internet
                                        Latency
                                                  How do we fix it?
                                          Tools


In the DOM




     Use fewer elements and assets
     Use more specific elements




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                         What’s the problem?
                            Bandwidth
                                         State of the internet
                               Latency
                                         How do we fix it?
                                 Tools




                      Latency




         WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  What’s the problem?
                                     Bandwidth
                                                  State of the internet
                                        Latency
                                                  How do we fix it?
                                          Tools


How fast can you drive?




   Latency deals with how long it takes to get a response after
                       making a request




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                   What’s the problem?
                                      Bandwidth
                                                   State of the internet
                                         Latency
                                                   How do we fix it?
                                           Tools


Speed Limits




    3 × 108 m /s – in vacuum
    2 × 108 m /s – in fibre
     =⇒ 21ms × 2
    (roundtrip from Boston to San
    Francisco)




                   WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                           What’s the problem?
                                              Bandwidth
                                                           State of the internet
                                                 Latency
                                                           How do we fix it?
                                                   Tools


42


         It should take a packet around 42ms to go from Boston to
         SF and back
         It actually takes around 83ms for a packet to go from
         Boston to SF and back
         This hasn’t changed in 14 years



 Ref: It’s the latency, stupid – Stuart Cheshire




                           WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                           What’s the problem?
                                              Bandwidth
                                                           State of the internet
                                                 Latency
                                                           How do we fix it?
                                                   Tools


42


         It should take a packet around 42ms to go from Boston to
         SF and back
         It actually takes around 83ms for a packet to go from
         Boston to SF and back
         This hasn’t changed in 14 years



 Ref: It’s the latency, stupid – Stuart Cheshire




                           WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  What’s the problem?
                                     Bandwidth
                                                  State of the internet
                                        Latency
                                                  How do we fix it?
                                          Tools


Latency isn’t sexy




    When was the last time you saw a TV commercial mention
                            latency?




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                What’s the problem?
                                   Bandwidth
                                                State of the internet
                                      Latency
                                                How do we fix it?
                                        Tools


ISPs




                WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                              What’s the problem?
                                             Bandwidth
                                                              State of the internet
                                                Latency
                                                              How do we fix it?
                                                  Tools


Australian ISPs




  Keep in mind that the Internet latency from Australia to the US is about 280ms




                          WebDU 2010 / 6-7 May 2010           Websites on Overdrive
Magic, Illusion and other Peformances
                                                  What’s the problem?
                                     Bandwidth
                                                  State of the internet
                                        Latency
                                                  How do we fix it?
                                          Tools


Getting around latency




     Don’t add latency – It’s bad enough without us adding to it
     Caching – Bring the data closer to where it’s needed
     Parallelise – Reduce the number of serial roundtrips
     Predict – Get data before it’s needed




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  What’s the problem?
                                     Bandwidth
                                                  State of the internet
                                        Latency
                                                  How do we fix it?
                                          Tools


Don’t add latency – Reduce lookups & Connections


     Limit the number of DNS lookups. 2-4 is okay.
     Limit the number of HTTP connections
         Concatenate CSS into a single file.
         Concatenate JS into one or two files.
         Combine images into sprites
         If you can, stuff everything into one call
         See search.yahoo.com
     Structure your page to avoid blocking
     Defer or post-load non-essential components




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  What’s the problem?
                                     Bandwidth
                                                  State of the internet
                                        Latency
                                                  How do we fix it?
                                          Tools


Don’t add latency – Be quick on the return




     Keep MaxClients at a reasonable value (30’s a good
     number)
     Flush your headers as soon as they’re done
     Flush your page content often
     Offload static content to a separate server




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                   What’s the problem?
                                      Bandwidth
                                                   State of the internet
                                         Latency
                                                   How do we fix it?
                                           Tools


Caching




     Turn on browser based caching wherever possible
     max-age, Expires & Cache-control
     Use a CDN, and make sure the CDN caches resources
     Use local copies of global references in Javascript
     Cache DOM nodes that you operate on a lot




                   WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                  What’s the problem?
                                     Bandwidth
                                                  State of the internet
                                        Latency
                                                  How do we fix it?
                                          Tools


Parallelise where possible




     Downloading scripts blocks page load, so do it in the
     background instead
     Browsers will download 4-8 resources from a host in
     parallel, take advantage of that
     Use event delegation




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                                           What’s the problem?
                                             Bandwidth
                                                           State of the internet
                                                Latency
                                                           How do we fix it?
                                                  Tools


Predict what’s next and fetch it



         If you know what the user will do next, pre-fetch it
                 Yahoo! Search page pre-loads sprites and Javascript for
                 the results page
                 Log analysis can tell you which pages are most popular,
                 and pre-fetch those
         Build expected DOM nodes before they’re needed




   Ref: Preload CSS & JS without execution – Stoyan Stefanov


                          WebDU 2010 / 6-7 May 2010        Websites on Overdrive
Magic, Illusion and other Peformances
                                                      What’s the problem?
                                         Bandwidth
                                                      State of the internet
                                            Latency
                                                      How do we fix it?
                                              Tools


One more thing




      Improving latency tends to improve bandwidth
      Increasing bandwidth can potentially worsen latency
      Larger packets take more time to assemble


  This is the difference between a 737 and a 747




                      WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                            Bandwidth
                               Latency
                                 Tools




                                    Tools




         WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                     Bandwidth
                                        Latency
                                          Tools


Useful tools for performance analysis



     YSlow – Firefox/Firebug plugin from Yahoo!
     PageSpeed – Firefox/Firebug plugin from Google
     PageTest – Web page testing tool
     ShowSlow – Automated YSlow runs against your URL
     Fiddler – Web debugging Proxy




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                     Bandwidth
                                        Latency
                                          Tools


Further reading




     developer.yahoo.com/performance – Yahoo!
     code.google.com/speed/page-speed/docs/rules_intro.html
     – Google
     stevesouders.com/blog/ – Steve Souders
     phpied.com – Stoyan Stefanov




                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                      Bandwidth
                                         Latency
                                           Tools


Contact Me



     Philip Tellis
     philip@bluesmoon.info
     @bluesmoon
     yahoo
     geek
     http://bluesmoon.info/
     slideshare.net/bluesmoon




                   WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                            Bandwidth
                               Latency
                                 Tools




                            Thank you




         WebDU 2010 / 6-7 May 2010       Websites on Overdrive
Magic, Illusion and other Peformances
                                     Bandwidth
                                        Latency
                                          Tools


Photo credits

     flickr.com/photos/ktylerconk/3154161850/
     flickr.com/photos/lwr/3631563009/
     flickr.com/photos/siennaisalive/4436708323/
     flickr.com/photos/jeremybrooks/4104176629/
     flickr.com/photos/aquilaonline/2055376852/
     flickr.com/photos/gi/117771718/
     flickr.com/photos/vlastula/300102949/
     flickr.com/photos/electrichamster/3160580687/
     flickr.com/photos/docman/36125185/
     flickr.com/photos/thomashawk/3162497239/


                  WebDU 2010 / 6-7 May 2010       Websites on Overdrive

More Related Content

More from Philip Tellis

Improving 3rd Party Script Performance With IFrames
Improving 3rd Party Script Performance With IFramesImproving 3rd Party Script Performance With IFrames
Improving 3rd Party Script Performance With IFrames
Philip Tellis
 
Analysing network characteristics with JavaScript
Analysing network characteristics with JavaScriptAnalysing network characteristics with JavaScript
Analysing network characteristics with JavaScript
Philip Tellis
 
A Node.JS bag of goodies for analyzing Web Traffic
A Node.JS bag of goodies for analyzing Web TrafficA Node.JS bag of goodies for analyzing Web Traffic
A Node.JS bag of goodies for analyzing Web Traffic
Philip Tellis
 
Boomerang: How fast do users think your site is?
Boomerang: How fast do users think your site is?Boomerang: How fast do users think your site is?
Boomerang: How fast do users think your site is?
Philip Tellis
 
Boomerang at FOSS.IN/2010
Boomerang at FOSS.IN/2010Boomerang at FOSS.IN/2010
Boomerang at FOSS.IN/2010
Philip Tellis
 
Measuring the web with Boomerang (YUIConf 2010)
Measuring the web with Boomerang (YUIConf 2010)Measuring the web with Boomerang (YUIConf 2010)
Measuring the web with Boomerang (YUIConf 2010)
Philip Tellis
 
Boomerang at the Boston Web Performance meetup
Boomerang at the Boston Web Performance meetupBoomerang at the Boston Web Performance meetup
Boomerang at the Boston Web Performance meetup
Philip Tellis
 
Boomerang @ NY Web Perf meetup
Boomerang @ NY Web Perf meetupBoomerang @ NY Web Perf meetup
Boomerang @ NY Web Perf meetup
Philip Tellis
 

More from Philip Tellis (20)

Frontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy PersonFrontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy Person
 
Frontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy PersonFrontend Performance: Beginner to Expert to Crazy Person
Frontend Performance: Beginner to Expert to Crazy Person
 
mmm... beacons
mmm... beaconsmmm... beacons
mmm... beacons
 
RUM Distillation 101 -- Part I
RUM Distillation 101 -- Part IRUM Distillation 101 -- Part I
RUM Distillation 101 -- Part I
 
Improving 3rd Party Script Performance With IFrames
Improving 3rd Party Script Performance With IFramesImproving 3rd Party Script Performance With IFrames
Improving 3rd Party Script Performance With IFrames
 
Extending Boomerang
Extending BoomerangExtending Boomerang
Extending Boomerang
 
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"
Abusing JavaScript to measure Web Performance, or, "how does boomerang work?"
 
The Statistics of Web Performance Analysis
The Statistics of Web Performance AnalysisThe Statistics of Web Performance Analysis
The Statistics of Web Performance Analysis
 
Abusing JavaScript to Measure Web Performance
Abusing JavaScript to Measure Web PerformanceAbusing JavaScript to Measure Web Performance
Abusing JavaScript to Measure Web Performance
 
Rum for Breakfast
Rum for BreakfastRum for Breakfast
Rum for Breakfast
 
Analysing network characteristics with JavaScript
Analysing network characteristics with JavaScriptAnalysing network characteristics with JavaScript
Analysing network characteristics with JavaScript
 
A Node.JS bag of goodies for analyzing Web Traffic
A Node.JS bag of goodies for analyzing Web TrafficA Node.JS bag of goodies for analyzing Web Traffic
A Node.JS bag of goodies for analyzing Web Traffic
 
Input sanitization
Input sanitizationInput sanitization
Input sanitization
 
Messing with JavaScript and the DOM to measure network characteristics
Messing with JavaScript and the DOM to measure network characteristicsMessing with JavaScript and the DOM to measure network characteristics
Messing with JavaScript and the DOM to measure network characteristics
 
Boomerang: How fast do users think your site is?
Boomerang: How fast do users think your site is?Boomerang: How fast do users think your site is?
Boomerang: How fast do users think your site is?
 
Boomerang at FOSS.IN/2010
Boomerang at FOSS.IN/2010Boomerang at FOSS.IN/2010
Boomerang at FOSS.IN/2010
 
Measuring the web with Boomerang (YUIConf 2010)
Measuring the web with Boomerang (YUIConf 2010)Measuring the web with Boomerang (YUIConf 2010)
Measuring the web with Boomerang (YUIConf 2010)
 
Boomerang at the Boston Web Performance meetup
Boomerang at the Boston Web Performance meetupBoomerang at the Boston Web Performance meetup
Boomerang at the Boston Web Performance meetup
 
Boomerang @ NY Web Perf meetup
Boomerang @ NY Web Perf meetupBoomerang @ NY Web Perf meetup
Boomerang @ NY Web Perf meetup
 
Measuring the web with boomerang
Measuring the web with boomerangMeasuring the web with boomerang
Measuring the web with boomerang
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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...
 
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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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...
 

Websites on overdrive

  • 1. Magic, Illusion and other Peformances Bandwidth Latency Tools Websites on Overdrive Philip Tellis / philip@bluesmoon.info WebDU 2010 / 6-7 May 2010 WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 2. Magic, Illusion and other Peformances Bandwidth Latency Tools $ finger philip Philip Tellis philip@bluesmoon.info @bluesmoon yahoo geek http://bluesmoon.info/ WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 3. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools Magic, Illusion and other Performances WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 4. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools User perception How fast does the user think it takes your page to load? Do you want a really fast page that appears to be slow? or do you want a slow page that appears to be fast? WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 5. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools User perception How fast does the user think it takes your page to load? Do you want a really fast page that appears to be slow? or do you want a slow page that appears to be fast? WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 6. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools User perception How fast does the user think it takes your page to load? Do you want a really fast page that appears to be slow? or do you want a slow page that appears to be fast? WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 7. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools Blink How many blinks between click and onload? The average human eye takes 300-400ms to blink Web search results (Google & Yahoo!) load in about 3 blinks WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 8. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools Blink How many blinks between click and onload? The average human eye takes 300-400ms to blink Web search results (Google & Yahoo!) load in about 3 blinks WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 9. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools Blink How many blinks between click and onload? The average human eye takes 300-400ms to blink Web search results (Google & Yahoo!) load in about 3 blinks WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 10. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools Games Double-buffering and the VBLANK WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 11. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools How expensive is that blink? Yahoo! – 400ms slower → 5-9% drop in full page loads Google – 400ms slower → search engagement reduces over time Bing – 1 sec slower → 2.8% revenue drop, 2 sec slower → 4.3% drop Ref: The business of performance – Stoyan Stefanov WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 12. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools ... and conversely Shopzilla – 6s → 1.2s resulted in 7-12% increase in conversion rate Netflix – 43% decrease in bandwidth bill after enabling compression What about You? Ref: The business of performance – Stoyan Stefanov WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 13. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools ... and conversely Shopzilla – 6s → 1.2s resulted in 7-12% increase in conversion rate Netflix – 43% decrease in bandwidth bill after enabling compression What about You? Ref: The business of performance – Stoyan Stefanov WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 14. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools The wheels behind the screen Performance improvement boils down to two things Bandwidth Latency Do you need to take the bus or a motorcycle? WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 15. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools The wheels behind the screen Performance improvement boils down to two things Bandwidth Latency Do you need to take the bus or a motorcycle? WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 16. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools The wheels behind the screen Performance improvement boils down to two things Bandwidth Latency Do you need to take the bus or a motorcycle? WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 17. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools The wheels behind the screen Performance improvement boils down to two things Bandwidth Latency Do you need to take the bus or a motorcycle? WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 18. Magic, Illusion and other Peformances Seeing is believing Bandwidth The cost of performance Latency Where should we concentrate? Tools Not just the network Not just the network, but also within the browser process WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 19. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools Bandwidth WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 20. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools How fat is your pipe? How much data can you get across at once? Telephone system built for p-t-p voice? Optical fibre network? Geoff speeding down the M5 with 50TB of Daemon’s backup tapes? Ref: Shannon’s Theorem WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 21. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools How fat is your pipe? How much data can you get across at once? Telephone system built for p-t-p voice? Optical fibre network? Geoff speeding down the M5 with 50TB of Daemon’s backup tapes? Ref: Shannon’s Theorem WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 22. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools How fat is your pipe? How much data can you get across at once? Telephone system built for p-t-p voice? Optical fibre network? Geoff speeding down the M5 with 50TB of Daemon’s backup tapes? Ref: Shannon’s Theorem WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 23. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools How fat is your pipe? How much data can you get across at once? Telephone system built for p-t-p voice? Optical fibre network? Geoff speeding down the M5 with 50TB of Daemon’s backup tapes? Ref: Shannon’s Theorem WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 24. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools Shannon’s Theorem S C = B × log2 (1 + ) N C – Channel capacity in bps B – Bandwidth in Hz S – Signal strength N – Noise strength – S/N measured in dB WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 25. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools Bandwidth can be bought Bandwidth has increased steadily over time Networks, hard drives, memory, CPU, system bus, everything. Bandwidth can be parallelised WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 26. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools Bandwidth sells Marketing loves a fat pipe WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 27. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools How fast is the internet? YUI Blog measured bandwidth at 1Mbps and latency of 262ms Ref: Analysing Bandwidth & Latency – YUI Blog WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 28. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools How fast is the internet? Akamai measured average global bandwidth at 1.7Mbps Ref: State of the Internet – Akamai WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 29. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools ISPs WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 30. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools Australian ISPs Keep in mind that the Internet latency from Australia to the US is about 280ms WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 31. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools Pay for infrastructure South Korea invested in high bandwidth internet Google is investing in WiFi and Fibre in the US Akamai puts CDNs on high speed networks near the user WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 32. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools Measure your user’s bandwidth Javascript code to measure your user’s bandwidth & latency bw-test v1.3 WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 33. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools Make more efficient use of bandwidth gzip all text over the network minify your HTML, Javascript and CSS smush your images WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 34. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools Caveat about gzipping 15% of users still get uncompressed responses Ref: Beyond Gzipping – Tony Gentilcore, Google WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 35. Magic, Illusion and other Peformances The easier of the two Bandwidth State of the internet Latency How do we fix it? Tools In the DOM Use fewer elements and assets Use more specific elements WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 36. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools Latency WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 37. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools How fast can you drive? Latency deals with how long it takes to get a response after making a request WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 38. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools Speed Limits 3 × 108 m /s – in vacuum 2 × 108 m /s – in fibre =⇒ 21ms × 2 (roundtrip from Boston to San Francisco) WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 39. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools 42 It should take a packet around 42ms to go from Boston to SF and back It actually takes around 83ms for a packet to go from Boston to SF and back This hasn’t changed in 14 years Ref: It’s the latency, stupid – Stuart Cheshire WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 40. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools 42 It should take a packet around 42ms to go from Boston to SF and back It actually takes around 83ms for a packet to go from Boston to SF and back This hasn’t changed in 14 years Ref: It’s the latency, stupid – Stuart Cheshire WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 41. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools Latency isn’t sexy When was the last time you saw a TV commercial mention latency? WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 42. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools ISPs WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 43. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools Australian ISPs Keep in mind that the Internet latency from Australia to the US is about 280ms WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 44. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools Getting around latency Don’t add latency – It’s bad enough without us adding to it Caching – Bring the data closer to where it’s needed Parallelise – Reduce the number of serial roundtrips Predict – Get data before it’s needed WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 45. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools Don’t add latency – Reduce lookups & Connections Limit the number of DNS lookups. 2-4 is okay. Limit the number of HTTP connections Concatenate CSS into a single file. Concatenate JS into one or two files. Combine images into sprites If you can, stuff everything into one call See search.yahoo.com Structure your page to avoid blocking Defer or post-load non-essential components WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 46. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools Don’t add latency – Be quick on the return Keep MaxClients at a reasonable value (30’s a good number) Flush your headers as soon as they’re done Flush your page content often Offload static content to a separate server WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 47. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools Caching Turn on browser based caching wherever possible max-age, Expires & Cache-control Use a CDN, and make sure the CDN caches resources Use local copies of global references in Javascript Cache DOM nodes that you operate on a lot WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 48. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools Parallelise where possible Downloading scripts blocks page load, so do it in the background instead Browsers will download 4-8 resources from a host in parallel, take advantage of that Use event delegation WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 49. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools Predict what’s next and fetch it If you know what the user will do next, pre-fetch it Yahoo! Search page pre-loads sprites and Javascript for the results page Log analysis can tell you which pages are most popular, and pre-fetch those Build expected DOM nodes before they’re needed Ref: Preload CSS & JS without execution – Stoyan Stefanov WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 50. Magic, Illusion and other Peformances What’s the problem? Bandwidth State of the internet Latency How do we fix it? Tools One more thing Improving latency tends to improve bandwidth Increasing bandwidth can potentially worsen latency Larger packets take more time to assemble This is the difference between a 737 and a 747 WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 51. Magic, Illusion and other Peformances Bandwidth Latency Tools Tools WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 52. Magic, Illusion and other Peformances Bandwidth Latency Tools Useful tools for performance analysis YSlow – Firefox/Firebug plugin from Yahoo! PageSpeed – Firefox/Firebug plugin from Google PageTest – Web page testing tool ShowSlow – Automated YSlow runs against your URL Fiddler – Web debugging Proxy WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 53. Magic, Illusion and other Peformances Bandwidth Latency Tools Further reading developer.yahoo.com/performance – Yahoo! code.google.com/speed/page-speed/docs/rules_intro.html – Google stevesouders.com/blog/ – Steve Souders phpied.com – Stoyan Stefanov WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 54. Magic, Illusion and other Peformances Bandwidth Latency Tools Contact Me Philip Tellis philip@bluesmoon.info @bluesmoon yahoo geek http://bluesmoon.info/ slideshare.net/bluesmoon WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 55. Magic, Illusion and other Peformances Bandwidth Latency Tools Thank you WebDU 2010 / 6-7 May 2010 Websites on Overdrive
  • 56. Magic, Illusion and other Peformances Bandwidth Latency Tools Photo credits flickr.com/photos/ktylerconk/3154161850/ flickr.com/photos/lwr/3631563009/ flickr.com/photos/siennaisalive/4436708323/ flickr.com/photos/jeremybrooks/4104176629/ flickr.com/photos/aquilaonline/2055376852/ flickr.com/photos/gi/117771718/ flickr.com/photos/vlastula/300102949/ flickr.com/photos/electrichamster/3160580687/ flickr.com/photos/docman/36125185/ flickr.com/photos/thomashawk/3162497239/ WebDU 2010 / 6-7 May 2010 Websites on Overdrive