SlideShare uma empresa Scribd logo
1 de 76
Baixar para ler offline
(c) 2009 Facebook, Inc. or its licensors.  "Facebook" is a registered trademark of Facebook, Inc.. All rights reserved. 1.0




Sunday, September 27, 2009                                                                                                                                 1
Making Facebook faster
           Frontend performance
         engineering
                                David Wei and Changhao
                                Jiang
         Velocity 2009
         Jun 24, 2009 San Jose, CA




Sunday, September 27, 2009                               2
Agenda

             1          Site speed matters

             2          Performance monitoring

             3          Static resource management

             4          Ajaxification

             5          Client side cache


Sunday, September 27, 2009                           3
Site speed matters!




Sunday, September 27, 2009              4
First thing first: site speed matters.
Site speed matters: large scale
                   200 million users, more than 4 billion page views /
                                          day

               ▪   10ms per page = more than 1 man-year
                   per day
                                                                             = more than 5 human-life of
                   time per year




Sunday, September 27, 2009                                                                                                                                                 5
Facebook cares site speed.   … -- so yes, we care about site speed.


With our scales, our 200 Million users generated more than 4 billion page loads per day.


If we can speed up each page load by 10 ms, aggregately, we will save our users 1 man-year of time per day; and accumulating over a year, that’s more than 5 human life
of time.


Site speed is also affecting our bottleline. Experiments show that if we reduce the latency by 600ms, the user click rate improves by more than 5%. We are currently running
an in-depth experiment on the impact of latency.
Site speed matters: emerging

         • Agile development




Sunday, September 27, 2009                                                                                                                                               6
On the other hand, there are huge challenges for a site like facebook in term of site performance optimization. Here are a few major ones….


Move fast, no stable code base


Fast Development: every week we release a new version of the site – with hundreds of code changes; tens of small code changes are pushed everyday. So the code base is
never stable and there is no time to stop for pure optimization
Site speed matters: emerging

         • Agile development

         • Deep integration




Sunday, September 27, 2009                                                                                                                                          7


Deep integration: Each facebook home page is customized for a particular user, with features developed by many teams – some of them are applications by 3rd party
developers, some of them are internal facebook feature – depending on the users’ adoption on the features and applications.
it also takes a lot of javascript to run them.
Site speed matters: emerging

         • Agile development

         • Deep integration

         • Viral adoption




Sunday, September 27, 2009                                                                                                                                                  8
Viral adoption: it is very hard to predict if a feature that is released today will be used by 1 million users or 10 million users next week. It is difficult to optimize
beforehand. The infrastructure has to be adaptable to the growth of user adoption.
• Agile development

         • Deep integration

         • Viral adoption

         • Heavily interactive




Sunday, September 27, 2009                                                                                                                                                9
… this talk, we will share our experience on how to make a site faster with these challenges


Heavy interaction: our pages have many dynamic features that rely on javascript. E.g. the in-browser chat and application dock provide very convenient user experience,
while it also takes a lot of javascript to run them.
Site speed matters: emerging

         • Agile development

         • Deep integration

         • Viral adoption

         • Heavily interactive




Sunday, September 27, 2009                                                                                                                                                10
In summary, we have a lot of challenges.


And these challenges are actually essential to make Facebook a paradise for people who want to build new things – you can write something cool tonight, and push it out
tomorrow to 200millions users. At the same time, it also makes the site performance hard to predict and maintain.


In this talk, we will share our experience on how to optimize front end performance with these challenges.
Site speed:                              end-to-end latency experienced by

       ▪   From a user request to the
           presentation of the page at
           the browser, interactive:
                                                                                  Rende                     Browsers
                                                                                                                                                   Content
            ▪   Network Transfer Time                                              r                                                               Distribution
                                                                                                                                                   Network
                                                                                                                                                   (CDN)
            ▪   Server Generation Time
            ▪   Client Render Time
                                                                                  ▪   NetTim



                                                                                  ▪   GenTim                                                        FB
                                                                                                                                                   Server

Sunday, September 27, 2009                                                                                                                                        11
Before going into details, we’d define our problem domains.


We define the end-to-end user latency as the time from user starts a page request, to the time the page is presented in the browser, interactive.


There are three components of latency in this process:


Network Transfer time is the time from the user browser to Facebook server, and back;
Server Generation time is the time spent on the Facebook servers;
And client render time is the time the browser spends on parsing the HTML, loading javascript/css/images and rendering the contents.
Site speed:                                end-to-end latency experienced by

                 User latency = RenderTime + NetTime + GenTime


                   ▪   RenderTime: ~50% of end-user latency


                   ▪   NetTime:                              ~25% of end-user latency


                   ▪   GenTime:                              ~25% of end-user latency



Sunday, September 27, 2009                                                                                                                                             12
Looking at facebook’s user latency, client side render time is about 50% of the end-to-end latency; network time and server-side generation time are about 25% each.
Site speed:                                 end-to-end latency experienced by

                 User latency = RenderTime + NetTime + GenTime


                    ▪   RenderTime: ~50% of end-user latency


                    ▪   NetTime:                            ~25% of end-user latency


                    ▪   GenTime:                            ~25% of end-user latency



Sunday, September 27, 2009                                                               13
In this talk, we focus on the biggest chunk: render time.
Cavalry: Site speed monitoring




Sunday, September 27, 2009                14
User-based measurement                                                                                            All content loaded,
                                         First bytes                                                                        Page Interactive
         What’s our speed?
                                   Server of HTML
         ▪ sampling 1/10000 page loads
                                                 JS                                                                                                      Report




Sunday, September 27, 2009                                                                                                                                               15
To make the site faster, the first question we want to ask is: what is our site speed?


There are usually two approaches: run some in-house testing, or samples on real users
We did both and found that the second approach is much more helpful for us.


We actually have lessons on the first approach: our pages are vastly different for different users, and Facebook employees are most likely to be the outliers because they
tend to have much more features and functionalities than normal users, and installed many plugins such as firebug, ie developers. even finding a “typical” users is hard, as
the usage behaviors of our users have been changing all the time.


Our approach is to take samples from our users. We have javascript measurement on a sampled users, 1/10000. to measure the real speed. The red arrows are the events
that we records.


This gives us a real image of what the site speed looks like for facebook.


Btw, we are loading the javascripts before our css, because the javascripts are loaded in parallel, along with css and images
User-based measurement                                                                                              All content loaded,
                                         First bytes                                                                          Page Interactive
         What’s our speed?
                                   Server of HTML
         ▪ sampling 1/10000 page loads
                                                 JS                                                                                                           Report




Sunday, September 27, 2009                                                                                                                                                    16
The last thing I want to point out on this slide is that, we are loading the javascripts before our css – this violates the common best practice of putting css in front of js.
However, the case here is that we are downloading most of our javascripts in parallel. If we put JS at top, we make JS, css and images are all in parallels. Half a year ago, we
tested and found this is faster. We are running another set of experiments to see if things changed.
Cavalry: Day-to-day monitoring
         What’s our speed?
         ▪   Collect gen time / network transfer time and render time

          GenTime                                                                                                                   Daily site speed
                                                                                                                                      monitoring
             Network
              Time

          Browser
        onload time                                                     Cavalry
                                                                         Logs




Sunday, September 27, 2009                                                                                                                             17
We combine the js measurement along with our serverside measurement on page generation time and network round trip time, and put it into a database.


Now we can yell to the company that “Hey the site is slower today!”.


However, we still don’t know who made it? We are continuously launching different features every week. It is hard to stop-and-test for performance.
Cavalry: Project-based analysis
         Who made it faster / slower?
         ▪   Integrated with Launch System

          GenTime                                                        Launch                                                Daily site speed
                                                                         System                                                  monitoring
             Network
              Time
                                                                                                                                 Project-based
          Browser                                                                                                                  regression
        onload time                                                      Cavalry                                                    detection
                                                                          Logs




Sunday, September 27, 2009                                                                                                                                          18
1. The second step of our measurement is to hook the logs with our launching system. For each measurement sample, we record what new features are launched in the
   page load.


2. When there is a regression, we can go over the samples and identify the feature launch that causes regression.


3. This can make the corresponding team much more responsive to a regression.


4. Then there is still a question: “why is it slow? How can I fix it?”
Cavalry: Numeric metrics
         Why are we fast / slow? How can I fix it?
         ▪   YSlow-like technical metrics

          GenTime                                                         Gate                                                     Daily site speed
                                                                         Keeper                                                      monitoring
             Network
              Time
                                                                                                                                     Project-based
          Browser                                                                                                                      regression
        onload time                                                      Cavalry                                                        detection
                                                                          Logs


         Yslow-like                                                                                                                     Regression
          metrics                                                                                                                        analysis

Sunday, September 27, 2009                                                                                                                                               19
To answer the “why” question, Yslow is a good tool.


1. We instrument a subset of the Yslow metrics into our sampled page load. We measure the # of images / # of dom nodes / # of script tags / # of html bytes / # of css
   rules and etc. These metrics can give indication on what causes a perf regression.


2. The missing thing is that we still don’t have a mapping from the yslow-metrics to the actual time (msec)
“WWW” in performance monitoring:
          What? Who? Why?


          ▪   User-based measurement:                                              unbiased, representative results


          ▪   Feature-launch integration: identify the regression


          ▪   Technical metrics:                                                          define actionable items for
              improvement



Sunday, September 27, 2009                                                                                                                            20
1. Missing part is the priority definition: how much saving, in ms, is if we reduce the # of css rules by 10%? Vs we move the js down to the bottom?
Haste: Static resource
         management




Sunday, September 27, 2009        21
Why we need SR Management?
         • Day 1: Some smart engineers start a project!
         <Print css tag for feature A>
                                           “Let’s write a
         <Print css tag for feature B>     new page with
                                           features A, B
         <Print css tag for feature C>     and C!”
         <print HTML of feature A>

         <print HTML of feature B>

         <print HTML of feature C>



Sunday, September 27, 2009                                  22
Why we need SR Management?
         • Day 2: Some smart engineers run PageSpeed and
           thinks…
         <Print css tag for feature A>   “A & B & C are
                                         always used;
         <Print css tag for feature B>   let’s package
                                         them
         <Print css tag for feature C>   together!”

         <print HTML of feature A>

         <print HTML of feature B>

         <print HTML of feature C>

Sunday, September 27, 2009                                 23
Why we need SR Management?
         • Day 2: Awesome!
         <Print css tag for feature
          A&B&C>

         <print HTML of feature A>

         <print HTML of feature B>

         <print HTML of feature C>

         …




Sunday, September 27, 2009            24
Why we need SR Management?
         • Day 3: feature C evolves…
         <Print css tag for feature A & B & C>

         <print HTML of feature A>

         <print HTML of feature B>

         If (users_signup_for_C()) { <print HTML of feature C>}

         …




Sunday, September 27, 2009                                        25
Why we need SR Management?
         • Day 3:
         <Print css tag for feature A & B & C>    A&B are always
                                                  used, while C is
         <print HTML of feature A>                not. ..

         <print HTML of feature B>

         If (users_signup_for_C()) { <print HTML of feature C>}

         …




Sunday, September 27, 2009                                           26
Why we need SR Management?
         • Day 4: feature C is deprecated
         <Print css tag for feature A & B & C>

         <print HTML of feature A>

         <print HTML of feature B>

         // no one uses C { <print HTML of feature C>}

         …




Sunday, September 27, 2009                               27
Why we need SR Management?
         • Day 4: we start to send unused bits
         <Print css tag for feature A & B & C>
                                                     It is hard to
         <print HTML of feature A>                   remember we
                                                     should remove C
         <print HTML of feature B>                   here.

         // no one uses C { <print HTML of feature C>}

         …




Sunday, September 27, 2009                                             28
Why we need SR Management?
         • One months later…
         <Print css tag for feature A & B & C & D & E & F & G…>
                                                        Thousands of
         if (F is used) <print HTML of feature F>       dead CSS rules in
                                                        the package.
         <print HTML of feature G>

         if (F is not used) { <print HTML of feature E>}

         …




Sunday, September 27, 2009                                                  29
Static Resource Management @
          Challenges:                            Responses:
          • Deep Integration                     • Separate requirement
                                                   declaration and delivery of static
          • Viral Adoption                         resources

          • Agile Development                    • Requirement declaration: lives
                                                   with HTML generation

                                                 • Delivery: Globally optimized




Sunday, September 27, 2009                                                              30
Deep Integration: each page has many features;
Viral adoption: usage pattern changes quickly
Agile development: feature changes fast
Haste: Static Resource Management
  Separate Declaration from
  actual Delivery
                             •             Back to Day 1:
                             require_static(A_css); <render HTML of feature
                               A>

                             require_static(B_css); <render HTML of feature B>

                             require_static(C_css);<render HTML Requirement Declaration lives
                                                                of feature C>
                                                                     with HTML

                             <deliver all required CSS>
                                                                      Global Optimization on Delivery
                             <print all rendered HTML>

Sunday, September 27, 2009                                                                              31
Haste: Global Optimization
    Online process                           Offline analysis
    require_static(A_css);<render HTML of
      feature A>
                                               Usage Pattern logs

    require_static(B_css); <render HTML of
      feature B>
                                               Clustering algorithms
    require_static(C_css); <render HTML of
      feature C>

                                               “Optimal” packages
    <deliver all required CSS>

    <print all rendered HTML>


Sunday, September 27, 2009                                             32
Haste: Trace-based Packaging
         Nov 2008 => May 2009
                                                                                                   # of pkg at a # of bytes at
                    Date                  # of JS files # of JS bytes
                                                                                                    home.php a home.php

               Nov 2008                            461                       4.4 MB                            29                     629 KB


               May 2009                            729                       5.9 MB                            14                     560 KB




Sunday, September 27, 2009                                                                                                                     33
The # of JS files are increased by 60%, the byte sites are increased by 30%. The # of pkg sent is halved, the byte size is 10% less.


find | grep -v .svn | grep -v intern | grep .css$ -c
find | grep -v .svn | grep -v intern | grep .css$ | xargs cat > /tmp/dwei_2008
Haste: Trace-based Packaging
         Nov 2008 => May 2009
                                                                                                      # of pkg at a # of bytes at
                     Date                   # of JS files # of JS bytes
                                                                                                       home.php a home.php

                Nov 2008                            461                        4.4 MB                             29   629 KB


                May 2009                            729                        5.9 MB                             14   560 KB



               'js/careers/jobs.js’,
               'js/lib/ui/timeeditor.js’,
               'resume/js/resumepro.js’,
               'resume/js/resumesection.js’



Sunday, September 27, 2009                                                                                                          34
Developers think that timeeditor.js is a library file – in fact, it is only used in one production page (career)
On the other hand, it turns out that “resume“ function is almost always used in career page.
Haste: Trace-based Packaging
         Nov 2008 => May 2009
                                                          # of pkg at a # of bytes at
                     Date    # of JS files # of JS bytes
                                                           home.php a home.php

                Nov 2008        461          4.4 MB            29          629 KB


                May 2009        729          5.9 MB            14          560 KB

                                            # of CSS      # of pkg at a # of bytes at
                     Date    # CSS files
                                             bytes         home.php a home.php

                Nov 2008         487         1.7 MB            24           69 KB


                May 2009         706         1.9 MB            15           64 KB

Sunday, September 27, 2009                                                              35
CSS is a similar story
Haste: Trace-based Analysis
         Potentials for image sprites too!
         • Thousands of virtual gifts with static images, which to sprite?




Sunday, September 27, 2009                                                   36
The same tracebase analysis techniques can be use in image spriting too:
Haste: Trace-based Analysis
         Potentials for image sprites too!
         • The answer is…




Sunday, September 27, 2009                           37
The answer is…


In retrospection, this is pretty straight forward.
Haste: Trace-based Analysis
         Adaptive Performance Optimization
         • JS / CSS package optimization

         • Guidance for image spriting

         • Guidance of progressive rendering




Sunday, September 27, 2009                                                                                                                                             38
Once we separate the declaration and delivery of static resources, we have tons of area for automatic optimizations with trace analysis.


You can do automatic packaging, you can do automatic spriting, you can also do automatic progressive rendering – you can look at the most frequently used resources,
and flush them out before generating the page.
Quickling: Ajaxify the Facebook
     site




Sunday, September 27, 2009             39
Remove redundant work via Ajax
                                     Full page load                    Ajax call


                               Page 1          Page 2          Page 3           Page 4

           Use session       load   unload   load   unload   load   unload    load   unload




Sunday, September 27, 2009                                                                    40
Remove redundant work via Ajax
                                     Full page load                    Ajax call


                               Page 1          Page 2          Page 3           Page 4

           Use session       load   unload   load   unload   load   unload    load   unload




Sunday, September 27, 2009                                                                    40
Remove redundant work via Ajax
                                     Full page load                    Ajax call


                               Page 1          Page 2          Page 3           Page 4

           Use session       load   unload   load   unload   load   unload    load   unload




                               Page 1          Page 2          Page 3           Page 4


           Use session       load                                                    unload



Sunday, September 27, 2009                                                                    40
How Quickling works?




Sunday, September 27, 2009      41
How Quickling works?
                             1. User clicks a link or back/forward
                             button




Sunday, September 27, 2009                                           41
How Quickling works?
                             1. User clicks a link or back/forward
                             button
                                    2. Quickling sends an ajax to server

                                          3. Response arrives




Sunday, September 27, 2009                                                 41
How Quickling works?
                                   1. User clicks a link or back/forward
                                   button
                                          2. Quickling sends an ajax to server

                                                3. Response arrives




 4. Quickling blanks the content
 area




Sunday, September 27, 2009                                                       41
How Quickling works?
                                             1. User clicks a link or back/forward
                                             button
                                                    2. Quickling sends an ajax to server

                                                          3. Response arrives




 4. Quickling blanks the content
 area
                5. Download javascript/CSS




Sunday, September 27, 2009                                                                 41
How Quickling works?
                                               1. User clicks a link or back/forward
                                               button
                                                      2. Quickling sends an ajax to server

                                                            3. Response arrives




 4. Quickling blanks the content
 area
                5. Download javascript/CSS

                             6. Show new content




Sunday, September 27, 2009                                                                   41
LinkController
         Intercept user clicks on links
         ▪   Dynamically attach a handler to all link clicks:
                             $(‘a’).click(function() {

                                // ‘payload’ is a JSON encoded response from the server
                                $.get(this.href, function(payload) {

                                    // Dynamically load ‘js’, ‘css’ resources for this page.
                                    bootload(payload.bootload, function() {

                                          // Swap in the new page’s content
                                          $(‘#content’).html(payload.html)

                                          // Execute the onloadRegister’ed js code
                                          execute(payload.onload)
                                    });
                                }
                             });



Sunday, September 27, 2009                                                                     42
HistoryManager
         Enable ‘Back/Forward’ buttons for AJAX requests
         ▪   Set target page URL as the fragment of the URL

              ▪ http://www.facebook.com/home.php

              ▪ http://www.facebook.com/home.php#/cjiang?ref=profile
              ▪ http://www.facebook.com/home.php#/friends/?ref=tn




Sunday, September 27, 2009                                            43
Bootloader
         Load static resources via ‘script’, ‘link’ tag injection
                             function requestResource(type, source) {
                               var h = document.getElementsByTagName('head')[0];
                                  switch (type) {
                                    case 'js':
                                      var script = document.createElement('script');
                                      script.src = source;
                                      script.type = 'text/javascript';
                                      h.appendChild(script);
                                      break;
                                 case 'css':
                                      var link = document.createElement('link');
                                      link.rel = "stylesheet";
                                      link.type = "text/css";
                                      link.media = "all" ;
                                      link.href = source;
                                      h.appendChild(link);
                                      break;
                                  }
                             }


Sunday, September 27, 2009                                                             44
Other details
         ▪   All pages now share a single global javascript scope:
             ▪ Explicitly reclaim resources or reset states before leaving a page
             ▪ Stub out setTimeout and setInterval

         ▪   All CSS rules will be accumulated
             ▪ Name-spacing CSS rules with page-specific information

         ▪   Busy indicator
              ▪iframe transport
         ▪   Permanent link
              ▪prelude inlined js code to redirect if necessary



Sunday, September 27, 2009                                                          45
Current status


         ▪   Turned on for FireFox and IE users: (>90% users)
         ▪   ~60% of page hits to Facebook site are Quickling requests




Sunday, September 27, 2009                                               46
Performance improvement




                40% ~ 50% reduction in render
                time
Sunday, September 27, 2009                      47
PageCache: Cache visited pages at client
     side




Sunday, September 27, 2009                      48
PageCache
         Cache user visited pages in browsers
         ▪   Motivation:
             ▪   A typical user session:
                 ▪   home -> profile -> photo -> home -> notes -> home -> photo
                     -> photo
             ▪   Some pages are likely to be revisited soon (temporal locality)
                 ▪   Home page visited every 3 ~ 5 page views
                 ▪   Back/Forward button




Sunday, September 27, 2009                                                        49
How PageCache works?
                                               1. User clicks a link or back
                                               button
                                                      2. Quickling sends ajax to server

                                                            3. Response arrives




 4. Quickling blanks the content
 area
                5. Download javascript/CSS

                             6. Show new content




Sunday, September 27, 2009                                                                50
How PageCache works?
                                               1. User clicks a link or back
                                               button
                                                      2. Quickling sends ajax to server

                                                            3. Response arrives

                                                                     3.5 Save response in
                                                                     cache


 4. Quickling blanks the content
 area
                5. Download javascript/CSS

                             6. Show new content




Sunday, September 27, 2009                                                                  50
How PageCache works?
                                               1. User clicks a link or back
                                               button
                                                      2. Quickling sends ajax to server

                                                            3. Response arrives




 4. Quickling blanks the content
 area
                5. Download javascript/CSS

                             6. Show new content




Sunday, September 27, 2009                                                                50
How PageCache works?
                                               1. User clicks a link or back
                                               button
                                                      2. Find Page in the cache

                                                            3. Response arrives




 4. Quickling blanks the content
 area
                5. Download javascript/CSS

                             6. Show new content




Sunday, September 27, 2009                                                        50
Cache consistency 1: Incremental
         updates




                       Cached version




Sunday, September 27, 2009                                                                                                                51
            Provide functions to programmers to allow registering a javascript function to be called right before cached page is shown.
            Used by home page to refresh ‘ads’, fetch latest stories
Cache consistency 1: Incremental
         updates




                       Cached version                                                                             Restored version




Sunday, September 27, 2009                                                                                                                51
            Provide functions to programmers to allow registering a javascript function to be called right before cached page is shown.
            Used by home page to refresh ‘ads’, fetch latest stories
Cache consistency 1: Incremental
         Poll server for incremental updates via ajax calls.
            ▪   Allow registering javascript functions to be called right before
                cached page is shown.
            ▪   Used by home page to refresh ‘ads’, fetch latest stories




                       Cached version                                                                             Restored version

Sunday, September 27, 2009                                                                                                                52
            Provide functions to programmers to allow registering a javascript function to be called right before cached page is shown.
            Used by home page to refresh ‘ads’, fetch latest stories
Cache consistency 2: In-page writes




                             Cached version




Sunday, September 27, 2009                     53
Cache consistency 2: In-page writes




                             Cached version   Restored version




Sunday, September 27, 2009                                       53
Cache consistency 2: In-page writes
         Record and replay
            ▪   Automatically record all state-changing operations in a cached
                page
            ▪   Automatically replay those operations when cached page is
                restored.




                             Cached version              Restored version
Sunday, September 27, 2009                                                       54
Cache consistency 3: Cross-page writes




               Cached version




Sunday, September 27, 2009                        55
Cache consistency 3: Cross-page writes




               Cached version   State-changing
                                      op




Sunday, September 27, 2009                        55
Cache consistency 3: Cross-page writes




               Cached version   State-changing   Restored version
                                      op




Sunday, September 27, 2009                                          55
Cache consistency 3: Cross-page writes
         Server side invalidation
            ▪   Instrument server-side database access API, whenever a write
                operations is detected, send a signal to the client to invalidate
                the cache.




                Cached version          State-changing           Restored version
                                              op


Sunday, September 27, 2009                                                          56
Current status

      ▪   Deployed on production
      ▪   Only cache in memory
      ▪   Only turned on for home page




Sunday, September 27, 2009               57
20%




                             ~20% savings on page hits to home
Sunday, September 27, 2009   page                                58
Performance improvement




  3X ~ 4X speedup in render time vs
  Quickling
Sunday, September 27, 2009            59
Summary




Sunday, September 27, 2009   60
Summary
         ▪   Performance monitoring: What, Who, and Why (“WWW”)
         ▪   Static resource management: Adaptive to fast evolution
         ▪   Ajaxify the website.
         ▪   Client side caching of user visited pages




Sunday, September 27, 2009                                                                                                                         61
Measurement: we need to answer three questions: what’s the speed, who made it faster/slower, why it is faster/slower.
Static resource management: need to be adaptive to fast evolution of code changes and user adoption


Ajaxifying websites where pages in a user session share a lot of common work can save the redundant work and improve user perceived performance.
Caching user’s visited pages on the client side can reduce server’s overall load and improve user perceived performance
Thank you!




Sunday, September 27, 2009                62

Mais conteúdo relacionado

Mais procurados

Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...Katie Sylor-Miller
 
10 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 201610 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 2016Chris Love
 
A Modern Approach to Performance Monitoring
A Modern Approach to Performance MonitoringA Modern Approach to Performance Monitoring
A Modern Approach to Performance MonitoringCliff Crocker
 
Satisfying the Need for Speed (By Aleh Barysevich of SEO PowerSuite, SMX Lond...
Satisfying the Need for Speed (By Aleh Barysevich of SEO PowerSuite, SMX Lond...Satisfying the Need for Speed (By Aleh Barysevich of SEO PowerSuite, SMX Lond...
Satisfying the Need for Speed (By Aleh Barysevich of SEO PowerSuite, SMX Lond...Link-Assistant.Com
 
Progressive Web App Challenges
Progressive Web App ChallengesProgressive Web App Challenges
Progressive Web App ChallengesJason Grigsby
 
Measuring what matters
Measuring what mattersMeasuring what matters
Measuring what mattersCliff Crocker
 
Dynamic Rendering for SEO by Nati Elimelech
Dynamic Rendering for SEO by Nati ElimelechDynamic Rendering for SEO by Nati Elimelech
Dynamic Rendering for SEO by Nati ElimelechNati Elimelech
 
SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...
SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...
SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...Distilled
 
Service workers your applications never felt so good
Service workers   your applications never felt so goodService workers   your applications never felt so good
Service workers your applications never felt so goodChris Love
 
Html5 Fit: Get Rid of Love Handles
Html5 Fit:  Get Rid of Love HandlesHtml5 Fit:  Get Rid of Love Handles
Html5 Fit: Get Rid of Love HandlesChris Love
 
Optimizing web performance (Fronteers edition)
Optimizing web performance (Fronteers edition)Optimizing web performance (Fronteers edition)
Optimizing web performance (Fronteers edition)Dave Olsen
 
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital MarketersSearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital MarketersDistilled
 
Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013Patrick Meenan
 
Using Responsive Web Design To Make Your Web Work Everywhere - Updated
Using Responsive Web Design To Make Your Web Work Everywhere - UpdatedUsing Responsive Web Design To Make Your Web Work Everywhere - Updated
Using Responsive Web Design To Make Your Web Work Everywhere - UpdatedChris Love
 
Measuring the visual experience of website performance
Measuring the visual experience of website performanceMeasuring the visual experience of website performance
Measuring the visual experience of website performancePatrick Meenan
 
Selecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutionsSelecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutionsPatrick Meenan
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsChris Love
 
Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work EverywhereUsing Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work EverywhereChris Love
 
Hacking Web Performance @ ForwardJS 2017
Hacking Web Performance @ ForwardJS 2017Hacking Web Performance @ ForwardJS 2017
Hacking Web Performance @ ForwardJS 2017Maximiliano Firtman
 

Mais procurados (20)

Browser Based Performance Testing and Tuning
Browser Based Performance Testing and TuningBrowser Based Performance Testing and Tuning
Browser Based Performance Testing and Tuning
 
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
 
10 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 201610 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 2016
 
A Modern Approach to Performance Monitoring
A Modern Approach to Performance MonitoringA Modern Approach to Performance Monitoring
A Modern Approach to Performance Monitoring
 
Satisfying the Need for Speed (By Aleh Barysevich of SEO PowerSuite, SMX Lond...
Satisfying the Need for Speed (By Aleh Barysevich of SEO PowerSuite, SMX Lond...Satisfying the Need for Speed (By Aleh Barysevich of SEO PowerSuite, SMX Lond...
Satisfying the Need for Speed (By Aleh Barysevich of SEO PowerSuite, SMX Lond...
 
Progressive Web App Challenges
Progressive Web App ChallengesProgressive Web App Challenges
Progressive Web App Challenges
 
Measuring what matters
Measuring what mattersMeasuring what matters
Measuring what matters
 
Dynamic Rendering for SEO by Nati Elimelech
Dynamic Rendering for SEO by Nati ElimelechDynamic Rendering for SEO by Nati Elimelech
Dynamic Rendering for SEO by Nati Elimelech
 
SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...
SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...
SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...
 
Service workers your applications never felt so good
Service workers   your applications never felt so goodService workers   your applications never felt so good
Service workers your applications never felt so good
 
Html5 Fit: Get Rid of Love Handles
Html5 Fit:  Get Rid of Love HandlesHtml5 Fit:  Get Rid of Love Handles
Html5 Fit: Get Rid of Love Handles
 
Optimizing web performance (Fronteers edition)
Optimizing web performance (Fronteers edition)Optimizing web performance (Fronteers edition)
Optimizing web performance (Fronteers edition)
 
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital MarketersSearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
 
Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013
 
Using Responsive Web Design To Make Your Web Work Everywhere - Updated
Using Responsive Web Design To Make Your Web Work Everywhere - UpdatedUsing Responsive Web Design To Make Your Web Work Everywhere - Updated
Using Responsive Web Design To Make Your Web Work Everywhere - Updated
 
Measuring the visual experience of website performance
Measuring the visual experience of website performanceMeasuring the visual experience of website performance
Measuring the visual experience of website performance
 
Selecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutionsSelecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutions
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applications
 
Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work EverywhereUsing Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work Everywhere
 
Hacking Web Performance @ ForwardJS 2017
Hacking Web Performance @ ForwardJS 2017Hacking Web Performance @ ForwardJS 2017
Hacking Web Performance @ ForwardJS 2017
 

Destaque

Happy facebook developer
Happy facebook developerHappy facebook developer
Happy facebook developerYu-Wei Chuang
 
Facebook App Development
Facebook App DevelopmentFacebook App Development
Facebook App DevelopmentCristiano Betta
 
Facebook Development with Zend Framework
Facebook Development with Zend FrameworkFacebook Development with Zend Framework
Facebook Development with Zend FrameworkBrett Harris
 
Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)Colin Su
 
Workshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKWorkshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKDimitar Danailov
 
Introduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDKIntroduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDKColin Su
 
Introduction to facebook java script sdk
Introduction to facebook java script sdk Introduction to facebook java script sdk
Introduction to facebook java script sdk Yi-Fan Chu
 
Introduction to facebook javascript sdk
Introduction to facebook javascript sdk Introduction to facebook javascript sdk
Introduction to facebook javascript sdk Yi-Fan Chu
 

Destaque (9)

Happy facebook developer
Happy facebook developerHappy facebook developer
Happy facebook developer
 
Facebook App Development
Facebook App DevelopmentFacebook App Development
Facebook App Development
 
Facebook Development with Zend Framework
Facebook Development with Zend FrameworkFacebook Development with Zend Framework
Facebook Development with Zend Framework
 
Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)
 
Workshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKWorkshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDK
 
Introduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDKIntroduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDK
 
Introduction to facebook java script sdk
Introduction to facebook java script sdk Introduction to facebook java script sdk
Introduction to facebook java script sdk
 
Introduction to facebook javascript sdk
Introduction to facebook javascript sdk Introduction to facebook javascript sdk
Introduction to facebook javascript sdk
 
Facebook + Ruby
Facebook + RubyFacebook + Ruby
Facebook + Ruby
 

Semelhante a Making Facebook Faster

Riding The N Train: How we dismantled Groupon's Ruby on Rails Monolith
Riding The N Train: How we dismantled Groupon's Ruby on Rails MonolithRiding The N Train: How we dismantled Groupon's Ruby on Rails Monolith
Riding The N Train: How we dismantled Groupon's Ruby on Rails MonolithSean McCullough
 
Simplified Web2.0 application development with Project Zero
Simplified Web2.0 application development with Project ZeroSimplified Web2.0 application development with Project Zero
Simplified Web2.0 application development with Project ZeroShawn Zhu
 
Entwicker camp2007 blackberry-workshop
Entwicker camp2007 blackberry-workshopEntwicker camp2007 blackberry-workshop
Entwicker camp2007 blackberry-workshopBill Buchan
 
Chicago from the Cloud
Chicago from the CloudChicago from the Cloud
Chicago from the CloudWAN-IFRA
 
HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09mihaiionescu
 
Station Four: Web Redesign Presentation
Station Four: Web Redesign PresentationStation Four: Web Redesign Presentation
Station Four: Web Redesign Presentationcolberding
 
Akamai 如何幫您的客戶用網站賺錢 how to monetize your site
Akamai 如何幫您的客戶用網站賺錢 how to monetize your siteAkamai 如何幫您的客戶用網站賺錢 how to monetize your site
Akamai 如何幫您的客戶用網站賺錢 how to monetize your site零壹科技股份有限公司
 
Get Connected – Using Open Source Technologies on Facebook
Get Connected – Using Open Source Technologies on FacebookGet Connected – Using Open Source Technologies on Facebook
Get Connected – Using Open Source Technologies on FacebookBinesh Gummadi
 
Beyond CDNs: How to Harness the Next Phase of Innovation in Web Performance
Beyond CDNs: How to Harness the Next Phase of Innovation in Web PerformanceBeyond CDNs: How to Harness the Next Phase of Innovation in Web Performance
Beyond CDNs: How to Harness the Next Phase of Innovation in Web PerformanceYottaa
 
A Designer's Guide to Web Performance
A Designer's Guide to Web PerformanceA Designer's Guide to Web Performance
A Designer's Guide to Web PerformanceKevin Mandeville
 
Mobile Performance Testing - Testing the Server
Mobile Performance Testing  - Testing the ServerMobile Performance Testing  - Testing the Server
Mobile Performance Testing - Testing the ServerXBOSoft
 
5 Best Practices For Blazing Fast Website Performance presented by Gomez & Fo...
5 Best Practices For Blazing Fast Website Performance presented by Gomez & Fo...5 Best Practices For Blazing Fast Website Performance presented by Gomez & Fo...
5 Best Practices For Blazing Fast Website Performance presented by Gomez & Fo...Compuware APM
 
The View - Deploying domino applications to BlackBerry MDS Studio
The View - Deploying domino applications to BlackBerry MDS StudioThe View - Deploying domino applications to BlackBerry MDS Studio
The View - Deploying domino applications to BlackBerry MDS StudioBill Buchan
 
Web 2.0 Application development with Ruby on Rails
Web 2.0 Application development with Ruby on RailsWeb 2.0 Application development with Ruby on Rails
Web 2.0 Application development with Ruby on RailsAmit Mathur
 
App Engine Overview Cloud Futures Publish
App Engine Overview Cloud Futures PublishApp Engine Overview Cloud Futures Publish
App Engine Overview Cloud Futures PublishChris Schalk
 
Put the client on the client
Put the client on the clientPut the client on the client
Put the client on the clientAndré Heie Vik
 
Front End page speed performance improvements for Drupal
Front End page speed performance improvements for DrupalFront End page speed performance improvements for Drupal
Front End page speed performance improvements for DrupalAndy Kucharski
 

Semelhante a Making Facebook Faster (20)

Riding The N Train: How we dismantled Groupon's Ruby on Rails Monolith
Riding The N Train: How we dismantled Groupon's Ruby on Rails MonolithRiding The N Train: How we dismantled Groupon's Ruby on Rails Monolith
Riding The N Train: How we dismantled Groupon's Ruby on Rails Monolith
 
Keynote I
Keynote IKeynote I
Keynote I
 
Simplified Web2.0 application development with Project Zero
Simplified Web2.0 application development with Project ZeroSimplified Web2.0 application development with Project Zero
Simplified Web2.0 application development with Project Zero
 
Entwicker camp2007 blackberry-workshop
Entwicker camp2007 blackberry-workshopEntwicker camp2007 blackberry-workshop
Entwicker camp2007 blackberry-workshop
 
Chicago from the Cloud
Chicago from the CloudChicago from the Cloud
Chicago from the Cloud
 
HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09
 
Station Four: Web Redesign Presentation
Station Four: Web Redesign PresentationStation Four: Web Redesign Presentation
Station Four: Web Redesign Presentation
 
Akamai 如何幫您的客戶用網站賺錢 how to monetize your site
Akamai 如何幫您的客戶用網站賺錢 how to monetize your siteAkamai 如何幫您的客戶用網站賺錢 how to monetize your site
Akamai 如何幫您的客戶用網站賺錢 how to monetize your site
 
Get Connected – Using Open Source Technologies on Facebook
Get Connected – Using Open Source Technologies on FacebookGet Connected – Using Open Source Technologies on Facebook
Get Connected – Using Open Source Technologies on Facebook
 
Beyond CDNs: How to Harness the Next Phase of Innovation in Web Performance
Beyond CDNs: How to Harness the Next Phase of Innovation in Web PerformanceBeyond CDNs: How to Harness the Next Phase of Innovation in Web Performance
Beyond CDNs: How to Harness the Next Phase of Innovation in Web Performance
 
Web performance e-book
Web performance e-bookWeb performance e-book
Web performance e-book
 
Designers Guide to Web Performance Yotta 2013
Designers Guide to Web Performance Yotta 2013Designers Guide to Web Performance Yotta 2013
Designers Guide to Web Performance Yotta 2013
 
A Designer's Guide to Web Performance
A Designer's Guide to Web PerformanceA Designer's Guide to Web Performance
A Designer's Guide to Web Performance
 
Mobile Performance Testing - Testing the Server
Mobile Performance Testing  - Testing the ServerMobile Performance Testing  - Testing the Server
Mobile Performance Testing - Testing the Server
 
5 Best Practices For Blazing Fast Website Performance presented by Gomez & Fo...
5 Best Practices For Blazing Fast Website Performance presented by Gomez & Fo...5 Best Practices For Blazing Fast Website Performance presented by Gomez & Fo...
5 Best Practices For Blazing Fast Website Performance presented by Gomez & Fo...
 
The View - Deploying domino applications to BlackBerry MDS Studio
The View - Deploying domino applications to BlackBerry MDS StudioThe View - Deploying domino applications to BlackBerry MDS Studio
The View - Deploying domino applications to BlackBerry MDS Studio
 
Web 2.0 Application development with Ruby on Rails
Web 2.0 Application development with Ruby on RailsWeb 2.0 Application development with Ruby on Rails
Web 2.0 Application development with Ruby on Rails
 
App Engine Overview Cloud Futures Publish
App Engine Overview Cloud Futures PublishApp Engine Overview Cloud Futures Publish
App Engine Overview Cloud Futures Publish
 
Put the client on the client
Put the client on the clientPut the client on the client
Put the client on the client
 
Front End page speed performance improvements for Drupal
Front End page speed performance improvements for DrupalFront End page speed performance improvements for Drupal
Front End page speed performance improvements for Drupal
 

Último

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Último (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

Making Facebook Faster

  • 1. (c) 2009 Facebook, Inc. or its licensors.  "Facebook" is a registered trademark of Facebook, Inc.. All rights reserved. 1.0 Sunday, September 27, 2009 1
  • 2. Making Facebook faster Frontend performance engineering David Wei and Changhao Jiang Velocity 2009 Jun 24, 2009 San Jose, CA Sunday, September 27, 2009 2
  • 3. Agenda 1 Site speed matters 2 Performance monitoring 3 Static resource management 4 Ajaxification 5 Client side cache Sunday, September 27, 2009 3
  • 4. Site speed matters! Sunday, September 27, 2009 4 First thing first: site speed matters.
  • 5. Site speed matters: large scale 200 million users, more than 4 billion page views / day ▪ 10ms per page = more than 1 man-year per day = more than 5 human-life of time per year Sunday, September 27, 2009 5 Facebook cares site speed. … -- so yes, we care about site speed. With our scales, our 200 Million users generated more than 4 billion page loads per day. If we can speed up each page load by 10 ms, aggregately, we will save our users 1 man-year of time per day; and accumulating over a year, that’s more than 5 human life of time. Site speed is also affecting our bottleline. Experiments show that if we reduce the latency by 600ms, the user click rate improves by more than 5%. We are currently running an in-depth experiment on the impact of latency.
  • 6. Site speed matters: emerging • Agile development Sunday, September 27, 2009 6 On the other hand, there are huge challenges for a site like facebook in term of site performance optimization. Here are a few major ones…. Move fast, no stable code base Fast Development: every week we release a new version of the site – with hundreds of code changes; tens of small code changes are pushed everyday. So the code base is never stable and there is no time to stop for pure optimization
  • 7. Site speed matters: emerging • Agile development • Deep integration Sunday, September 27, 2009 7 Deep integration: Each facebook home page is customized for a particular user, with features developed by many teams – some of them are applications by 3rd party developers, some of them are internal facebook feature – depending on the users’ adoption on the features and applications. it also takes a lot of javascript to run them.
  • 8. Site speed matters: emerging • Agile development • Deep integration • Viral adoption Sunday, September 27, 2009 8 Viral adoption: it is very hard to predict if a feature that is released today will be used by 1 million users or 10 million users next week. It is difficult to optimize beforehand. The infrastructure has to be adaptable to the growth of user adoption.
  • 9. • Agile development • Deep integration • Viral adoption • Heavily interactive Sunday, September 27, 2009 9 … this talk, we will share our experience on how to make a site faster with these challenges Heavy interaction: our pages have many dynamic features that rely on javascript. E.g. the in-browser chat and application dock provide very convenient user experience, while it also takes a lot of javascript to run them.
  • 10. Site speed matters: emerging • Agile development • Deep integration • Viral adoption • Heavily interactive Sunday, September 27, 2009 10 In summary, we have a lot of challenges. And these challenges are actually essential to make Facebook a paradise for people who want to build new things – you can write something cool tonight, and push it out tomorrow to 200millions users. At the same time, it also makes the site performance hard to predict and maintain. In this talk, we will share our experience on how to optimize front end performance with these challenges.
  • 11. Site speed: end-to-end latency experienced by ▪ From a user request to the presentation of the page at the browser, interactive: Rende Browsers Content ▪ Network Transfer Time r Distribution Network (CDN) ▪ Server Generation Time ▪ Client Render Time ▪ NetTim ▪ GenTim FB Server Sunday, September 27, 2009 11 Before going into details, we’d define our problem domains. We define the end-to-end user latency as the time from user starts a page request, to the time the page is presented in the browser, interactive. There are three components of latency in this process: Network Transfer time is the time from the user browser to Facebook server, and back; Server Generation time is the time spent on the Facebook servers; And client render time is the time the browser spends on parsing the HTML, loading javascript/css/images and rendering the contents.
  • 12. Site speed: end-to-end latency experienced by User latency = RenderTime + NetTime + GenTime ▪ RenderTime: ~50% of end-user latency ▪ NetTime: ~25% of end-user latency ▪ GenTime: ~25% of end-user latency Sunday, September 27, 2009 12 Looking at facebook’s user latency, client side render time is about 50% of the end-to-end latency; network time and server-side generation time are about 25% each.
  • 13. Site speed: end-to-end latency experienced by User latency = RenderTime + NetTime + GenTime ▪ RenderTime: ~50% of end-user latency ▪ NetTime: ~25% of end-user latency ▪ GenTime: ~25% of end-user latency Sunday, September 27, 2009 13 In this talk, we focus on the biggest chunk: render time.
  • 14. Cavalry: Site speed monitoring Sunday, September 27, 2009 14
  • 15. User-based measurement All content loaded, First bytes Page Interactive What’s our speed? Server of HTML ▪ sampling 1/10000 page loads JS Report Sunday, September 27, 2009 15 To make the site faster, the first question we want to ask is: what is our site speed? There are usually two approaches: run some in-house testing, or samples on real users We did both and found that the second approach is much more helpful for us. We actually have lessons on the first approach: our pages are vastly different for different users, and Facebook employees are most likely to be the outliers because they tend to have much more features and functionalities than normal users, and installed many plugins such as firebug, ie developers. even finding a “typical” users is hard, as the usage behaviors of our users have been changing all the time. Our approach is to take samples from our users. We have javascript measurement on a sampled users, 1/10000. to measure the real speed. The red arrows are the events that we records. This gives us a real image of what the site speed looks like for facebook. Btw, we are loading the javascripts before our css, because the javascripts are loaded in parallel, along with css and images
  • 16. User-based measurement All content loaded, First bytes Page Interactive What’s our speed? Server of HTML ▪ sampling 1/10000 page loads JS Report Sunday, September 27, 2009 16 The last thing I want to point out on this slide is that, we are loading the javascripts before our css – this violates the common best practice of putting css in front of js. However, the case here is that we are downloading most of our javascripts in parallel. If we put JS at top, we make JS, css and images are all in parallels. Half a year ago, we tested and found this is faster. We are running another set of experiments to see if things changed.
  • 17. Cavalry: Day-to-day monitoring What’s our speed? ▪ Collect gen time / network transfer time and render time GenTime Daily site speed monitoring Network Time Browser onload time Cavalry Logs Sunday, September 27, 2009 17 We combine the js measurement along with our serverside measurement on page generation time and network round trip time, and put it into a database. Now we can yell to the company that “Hey the site is slower today!”. However, we still don’t know who made it? We are continuously launching different features every week. It is hard to stop-and-test for performance.
  • 18. Cavalry: Project-based analysis Who made it faster / slower? ▪ Integrated with Launch System GenTime Launch Daily site speed System monitoring Network Time Project-based Browser regression onload time Cavalry detection Logs Sunday, September 27, 2009 18 1. The second step of our measurement is to hook the logs with our launching system. For each measurement sample, we record what new features are launched in the page load. 2. When there is a regression, we can go over the samples and identify the feature launch that causes regression. 3. This can make the corresponding team much more responsive to a regression. 4. Then there is still a question: “why is it slow? How can I fix it?”
  • 19. Cavalry: Numeric metrics Why are we fast / slow? How can I fix it? ▪ YSlow-like technical metrics GenTime Gate Daily site speed Keeper monitoring Network Time Project-based Browser regression onload time Cavalry detection Logs Yslow-like Regression metrics analysis Sunday, September 27, 2009 19 To answer the “why” question, Yslow is a good tool. 1. We instrument a subset of the Yslow metrics into our sampled page load. We measure the # of images / # of dom nodes / # of script tags / # of html bytes / # of css rules and etc. These metrics can give indication on what causes a perf regression. 2. The missing thing is that we still don’t have a mapping from the yslow-metrics to the actual time (msec)
  • 20. “WWW” in performance monitoring: What? Who? Why? ▪ User-based measurement: unbiased, representative results ▪ Feature-launch integration: identify the regression ▪ Technical metrics: define actionable items for improvement Sunday, September 27, 2009 20 1. Missing part is the priority definition: how much saving, in ms, is if we reduce the # of css rules by 10%? Vs we move the js down to the bottom?
  • 21. Haste: Static resource management Sunday, September 27, 2009 21
  • 22. Why we need SR Management? • Day 1: Some smart engineers start a project! <Print css tag for feature A> “Let’s write a <Print css tag for feature B> new page with features A, B <Print css tag for feature C> and C!” <print HTML of feature A> <print HTML of feature B> <print HTML of feature C> Sunday, September 27, 2009 22
  • 23. Why we need SR Management? • Day 2: Some smart engineers run PageSpeed and thinks… <Print css tag for feature A> “A & B & C are always used; <Print css tag for feature B> let’s package them <Print css tag for feature C> together!” <print HTML of feature A> <print HTML of feature B> <print HTML of feature C> Sunday, September 27, 2009 23
  • 24. Why we need SR Management? • Day 2: Awesome! <Print css tag for feature A&B&C> <print HTML of feature A> <print HTML of feature B> <print HTML of feature C> … Sunday, September 27, 2009 24
  • 25. Why we need SR Management? • Day 3: feature C evolves… <Print css tag for feature A & B & C> <print HTML of feature A> <print HTML of feature B> If (users_signup_for_C()) { <print HTML of feature C>} … Sunday, September 27, 2009 25
  • 26. Why we need SR Management? • Day 3: <Print css tag for feature A & B & C> A&B are always used, while C is <print HTML of feature A> not. .. <print HTML of feature B> If (users_signup_for_C()) { <print HTML of feature C>} … Sunday, September 27, 2009 26
  • 27. Why we need SR Management? • Day 4: feature C is deprecated <Print css tag for feature A & B & C> <print HTML of feature A> <print HTML of feature B> // no one uses C { <print HTML of feature C>} … Sunday, September 27, 2009 27
  • 28. Why we need SR Management? • Day 4: we start to send unused bits <Print css tag for feature A & B & C> It is hard to <print HTML of feature A> remember we should remove C <print HTML of feature B> here. // no one uses C { <print HTML of feature C>} … Sunday, September 27, 2009 28
  • 29. Why we need SR Management? • One months later… <Print css tag for feature A & B & C & D & E & F & G…> Thousands of if (F is used) <print HTML of feature F> dead CSS rules in the package. <print HTML of feature G> if (F is not used) { <print HTML of feature E>} … Sunday, September 27, 2009 29
  • 30. Static Resource Management @ Challenges: Responses: • Deep Integration • Separate requirement declaration and delivery of static • Viral Adoption resources • Agile Development • Requirement declaration: lives with HTML generation • Delivery: Globally optimized Sunday, September 27, 2009 30 Deep Integration: each page has many features; Viral adoption: usage pattern changes quickly Agile development: feature changes fast
  • 31. Haste: Static Resource Management Separate Declaration from actual Delivery • Back to Day 1: require_static(A_css); <render HTML of feature A> require_static(B_css); <render HTML of feature B> require_static(C_css);<render HTML Requirement Declaration lives of feature C> with HTML <deliver all required CSS> Global Optimization on Delivery <print all rendered HTML> Sunday, September 27, 2009 31
  • 32. Haste: Global Optimization Online process Offline analysis require_static(A_css);<render HTML of feature A> Usage Pattern logs require_static(B_css); <render HTML of feature B> Clustering algorithms require_static(C_css); <render HTML of feature C> “Optimal” packages <deliver all required CSS> <print all rendered HTML> Sunday, September 27, 2009 32
  • 33. Haste: Trace-based Packaging Nov 2008 => May 2009 # of pkg at a # of bytes at Date # of JS files # of JS bytes home.php a home.php Nov 2008 461 4.4 MB 29 629 KB May 2009 729 5.9 MB 14 560 KB Sunday, September 27, 2009 33 The # of JS files are increased by 60%, the byte sites are increased by 30%. The # of pkg sent is halved, the byte size is 10% less. find | grep -v .svn | grep -v intern | grep .css$ -c find | grep -v .svn | grep -v intern | grep .css$ | xargs cat > /tmp/dwei_2008
  • 34. Haste: Trace-based Packaging Nov 2008 => May 2009 # of pkg at a # of bytes at Date # of JS files # of JS bytes home.php a home.php Nov 2008 461 4.4 MB 29 629 KB May 2009 729 5.9 MB 14 560 KB  'js/careers/jobs.js’,  'js/lib/ui/timeeditor.js’,  'resume/js/resumepro.js’,  'resume/js/resumesection.js’ Sunday, September 27, 2009 34 Developers think that timeeditor.js is a library file – in fact, it is only used in one production page (career) On the other hand, it turns out that “resume“ function is almost always used in career page.
  • 35. Haste: Trace-based Packaging Nov 2008 => May 2009 # of pkg at a # of bytes at Date # of JS files # of JS bytes home.php a home.php Nov 2008 461 4.4 MB 29 629 KB May 2009 729 5.9 MB 14 560 KB # of CSS # of pkg at a # of bytes at Date # CSS files bytes home.php a home.php Nov 2008 487 1.7 MB 24 69 KB May 2009 706 1.9 MB 15 64 KB Sunday, September 27, 2009 35 CSS is a similar story
  • 36. Haste: Trace-based Analysis Potentials for image sprites too! • Thousands of virtual gifts with static images, which to sprite? Sunday, September 27, 2009 36 The same tracebase analysis techniques can be use in image spriting too:
  • 37. Haste: Trace-based Analysis Potentials for image sprites too! • The answer is… Sunday, September 27, 2009 37 The answer is… In retrospection, this is pretty straight forward.
  • 38. Haste: Trace-based Analysis Adaptive Performance Optimization • JS / CSS package optimization • Guidance for image spriting • Guidance of progressive rendering Sunday, September 27, 2009 38 Once we separate the declaration and delivery of static resources, we have tons of area for automatic optimizations with trace analysis. You can do automatic packaging, you can do automatic spriting, you can also do automatic progressive rendering – you can look at the most frequently used resources, and flush them out before generating the page.
  • 39. Quickling: Ajaxify the Facebook site Sunday, September 27, 2009 39
  • 40. Remove redundant work via Ajax Full page load Ajax call Page 1 Page 2 Page 3 Page 4 Use session load unload load unload load unload load unload Sunday, September 27, 2009 40
  • 41. Remove redundant work via Ajax Full page load Ajax call Page 1 Page 2 Page 3 Page 4 Use session load unload load unload load unload load unload Sunday, September 27, 2009 40
  • 42. Remove redundant work via Ajax Full page load Ajax call Page 1 Page 2 Page 3 Page 4 Use session load unload load unload load unload load unload Page 1 Page 2 Page 3 Page 4 Use session load unload Sunday, September 27, 2009 40
  • 43. How Quickling works? Sunday, September 27, 2009 41
  • 44. How Quickling works? 1. User clicks a link or back/forward button Sunday, September 27, 2009 41
  • 45. How Quickling works? 1. User clicks a link or back/forward button 2. Quickling sends an ajax to server 3. Response arrives Sunday, September 27, 2009 41
  • 46. How Quickling works? 1. User clicks a link or back/forward button 2. Quickling sends an ajax to server 3. Response arrives 4. Quickling blanks the content area Sunday, September 27, 2009 41
  • 47. How Quickling works? 1. User clicks a link or back/forward button 2. Quickling sends an ajax to server 3. Response arrives 4. Quickling blanks the content area 5. Download javascript/CSS Sunday, September 27, 2009 41
  • 48. How Quickling works? 1. User clicks a link or back/forward button 2. Quickling sends an ajax to server 3. Response arrives 4. Quickling blanks the content area 5. Download javascript/CSS 6. Show new content Sunday, September 27, 2009 41
  • 49. LinkController Intercept user clicks on links ▪ Dynamically attach a handler to all link clicks: $(‘a’).click(function() { // ‘payload’ is a JSON encoded response from the server $.get(this.href, function(payload) { // Dynamically load ‘js’, ‘css’ resources for this page. bootload(payload.bootload, function() { // Swap in the new page’s content $(‘#content’).html(payload.html) // Execute the onloadRegister’ed js code execute(payload.onload) }); } }); Sunday, September 27, 2009 42
  • 50. HistoryManager Enable ‘Back/Forward’ buttons for AJAX requests ▪ Set target page URL as the fragment of the URL ▪ http://www.facebook.com/home.php ▪ http://www.facebook.com/home.php#/cjiang?ref=profile ▪ http://www.facebook.com/home.php#/friends/?ref=tn Sunday, September 27, 2009 43
  • 51. Bootloader Load static resources via ‘script’, ‘link’ tag injection function requestResource(type, source) { var h = document.getElementsByTagName('head')[0]; switch (type) { case 'js': var script = document.createElement('script'); script.src = source; script.type = 'text/javascript'; h.appendChild(script); break; case 'css': var link = document.createElement('link'); link.rel = "stylesheet"; link.type = "text/css"; link.media = "all" ; link.href = source; h.appendChild(link); break; } } Sunday, September 27, 2009 44
  • 52. Other details ▪ All pages now share a single global javascript scope: ▪ Explicitly reclaim resources or reset states before leaving a page ▪ Stub out setTimeout and setInterval ▪ All CSS rules will be accumulated ▪ Name-spacing CSS rules with page-specific information ▪ Busy indicator ▪iframe transport ▪ Permanent link ▪prelude inlined js code to redirect if necessary Sunday, September 27, 2009 45
  • 53. Current status ▪ Turned on for FireFox and IE users: (>90% users) ▪ ~60% of page hits to Facebook site are Quickling requests Sunday, September 27, 2009 46
  • 54. Performance improvement 40% ~ 50% reduction in render time Sunday, September 27, 2009 47
  • 55. PageCache: Cache visited pages at client side Sunday, September 27, 2009 48
  • 56. PageCache Cache user visited pages in browsers ▪ Motivation: ▪ A typical user session: ▪ home -> profile -> photo -> home -> notes -> home -> photo -> photo ▪ Some pages are likely to be revisited soon (temporal locality) ▪ Home page visited every 3 ~ 5 page views ▪ Back/Forward button Sunday, September 27, 2009 49
  • 57. How PageCache works? 1. User clicks a link or back button 2. Quickling sends ajax to server 3. Response arrives 4. Quickling blanks the content area 5. Download javascript/CSS 6. Show new content Sunday, September 27, 2009 50
  • 58. How PageCache works? 1. User clicks a link or back button 2. Quickling sends ajax to server 3. Response arrives 3.5 Save response in cache 4. Quickling blanks the content area 5. Download javascript/CSS 6. Show new content Sunday, September 27, 2009 50
  • 59. How PageCache works? 1. User clicks a link or back button 2. Quickling sends ajax to server 3. Response arrives 4. Quickling blanks the content area 5. Download javascript/CSS 6. Show new content Sunday, September 27, 2009 50
  • 60. How PageCache works? 1. User clicks a link or back button 2. Find Page in the cache 3. Response arrives 4. Quickling blanks the content area 5. Download javascript/CSS 6. Show new content Sunday, September 27, 2009 50
  • 61. Cache consistency 1: Incremental updates Cached version Sunday, September 27, 2009 51 Provide functions to programmers to allow registering a javascript function to be called right before cached page is shown. Used by home page to refresh ‘ads’, fetch latest stories
  • 62. Cache consistency 1: Incremental updates Cached version Restored version Sunday, September 27, 2009 51 Provide functions to programmers to allow registering a javascript function to be called right before cached page is shown. Used by home page to refresh ‘ads’, fetch latest stories
  • 63. Cache consistency 1: Incremental Poll server for incremental updates via ajax calls. ▪ Allow registering javascript functions to be called right before cached page is shown. ▪ Used by home page to refresh ‘ads’, fetch latest stories Cached version Restored version Sunday, September 27, 2009 52 Provide functions to programmers to allow registering a javascript function to be called right before cached page is shown. Used by home page to refresh ‘ads’, fetch latest stories
  • 64. Cache consistency 2: In-page writes Cached version Sunday, September 27, 2009 53
  • 65. Cache consistency 2: In-page writes Cached version Restored version Sunday, September 27, 2009 53
  • 66. Cache consistency 2: In-page writes Record and replay ▪ Automatically record all state-changing operations in a cached page ▪ Automatically replay those operations when cached page is restored. Cached version Restored version Sunday, September 27, 2009 54
  • 67. Cache consistency 3: Cross-page writes Cached version Sunday, September 27, 2009 55
  • 68. Cache consistency 3: Cross-page writes Cached version State-changing op Sunday, September 27, 2009 55
  • 69. Cache consistency 3: Cross-page writes Cached version State-changing Restored version op Sunday, September 27, 2009 55
  • 70. Cache consistency 3: Cross-page writes Server side invalidation ▪ Instrument server-side database access API, whenever a write operations is detected, send a signal to the client to invalidate the cache. Cached version State-changing Restored version op Sunday, September 27, 2009 56
  • 71. Current status ▪ Deployed on production ▪ Only cache in memory ▪ Only turned on for home page Sunday, September 27, 2009 57
  • 72. 20% ~20% savings on page hits to home Sunday, September 27, 2009 page 58
  • 73. Performance improvement 3X ~ 4X speedup in render time vs Quickling Sunday, September 27, 2009 59
  • 75. Summary ▪ Performance monitoring: What, Who, and Why (“WWW”) ▪ Static resource management: Adaptive to fast evolution ▪ Ajaxify the website. ▪ Client side caching of user visited pages Sunday, September 27, 2009 61 Measurement: we need to answer three questions: what’s the speed, who made it faster/slower, why it is faster/slower. Static resource management: need to be adaptive to fast evolution of code changes and user adoption Ajaxifying websites where pages in a user session share a lot of common work can save the redundant work and improve user perceived performance. Caching user’s visited pages on the client side can reduce server’s overall load and improve user perceived performance