SlideShare a Scribd company logo
(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.

Recommended for you

A Modern Approach to Performance Monitoring
A Modern Approach to Performance MonitoringA Modern Approach to Performance Monitoring
A Modern Approach to Performance Monitoring

Akamai Edge 14 - Discussion on RUM, Synthetic and setting realistic and meaningful performance goals.

rumwebperfsoasta
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...

Page Speed can make or break your business in 2018, as it is equally important for user experience, revenue, and SEO. Mobile page speed is becoming a Goolge ranking factor in July 2018, or is it already as of May 2018? To get an idea about the current state of the industry, SEO PowerSuite conducts an experiment for 1 mln pages to find the correlation between mobile page speed in the position in mobile SERPs. In this presentation, delivered by Aleh Barysevich at SMX London, you'll find the results of the experiment, as well as the latest tools and tips on improving page speed.

seogooglepage speed
Progressive Web App Challenges
Progressive Web App ChallengesProgressive Web App Challenges
Progressive Web App Challenges

The document discusses progressive web apps (PWAs) and outlines key considerations for creating a PWA. It addresses questions around what a PWA is, how to make a website feel like an app, offline functionality, push notifications, and creating a roadmap. Examples from companies that implemented PWAs successfully are provided. The conclusion recommends developing a progressive roadmap that starts with baseline PWA features and builds out functionality over time based on priorities and initiatives.

progressivewebapp
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.

Recommended for you

Measuring what matters
Measuring what mattersMeasuring what matters
Measuring what matters

Metrics are everywhere! We’ve done a great job of keeping pace with measuring the output of our applications, but how are we doing with measuring what really matters? This talk will explore the various metrics available to application owners today, highlight what’s coming tomorrow and level-set on the relative importance as it relates to the user experience.

performanceakamaiedgerum
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

1. The document discusses dynamic rendering techniques for websites built with JavaScript frameworks like React, including client-side rendering (CSR) and server-side rendering (SSR). 2. With dynamic rendering, sites can serve pre-rendered HTML to search engines and bots while using CSR for users, allowing compatibility with all clients while optimizing performance. 3. Maintaining parity between what bots and users see is important for SEO, and the document provides recommendations for tools and techniques to check for rendering issues between different user agents and JavaScript settings.

seossrdynamic rendering
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...

HTTP/2 and Service Works are becoming more established, yet the SEO community lacks awareness of what they are what they may mean for us. A lot of us know we need to know about them but we manage to keep putting it off. However, for both of these technologies, the next 12 months are going to be the turning point where we really can't avoid learning more about them. Tom will provide and accessible introduction to both, with a focus on what they are, how they work and what SEOs need to know. If you have been scared of jumping in to them until now, this session will help get you up to speed.

searchlovesearchlove sandiego
• 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.

Recommended for you

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

If you have not heard of service workers you must attend this session. Service Workers encompass new browser capabilities, along with shiny new version of AJAX called Fetch. If you have every wanted your web applications to experience many native application features, such as push notifications, service workers is the gateway to your happiness. Have you felt confused by application cache and going offline? Well service workers enable offline experiences in a much cleaner way. But that is not all! If you want to see some of the cool new, advanced web platform features that you will actually use come to this session! https://love2dev.com/blog/what-is-a-service-worker/

service workersprogressive web applicationspwa
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

According to HTTPArchive.org the average web page is now larger than the original DOOM installation application. Today's obese web is leading to decreased user satisfaction, customer engagement and increased cost of ownership. Research repeatedly tells us customers want faster user experiences. Search engines reward faster sites with better rankings. Small, fast sites are cheaper to develop, maintain and operate. - Why has the web become obese? - What actions can developers and stakeholders do to combat their morbid obesity? - Are these actions expensive or hard to implement? This session reviews what customers want and how to identify your web site's love handles. More importantly you will learn simple techniques to eliminate the fat and create a healthy, maintainable, affordable web development lifestyle that produces the user experiences your customers want to engage with over and over.

csswebsitehtml5
Optimizing web performance (Fronteers edition)
Optimizing web performance (Fronteers edition)Optimizing web performance (Fronteers edition)
Optimizing web performance (Fronteers edition)

Today, a web page can be delivered to desktop computers, televisions, or handheld devices like tablets or phones. While a technique like responsive design helps ensure that our web sites look good across that spectrum of devices we may forget that we need to make sure that our web sites also perform well across that same spectrum. More and more of our users are shifting their Internet usage to these more varied platforms and connection speeds with some moving entirely to mobile Internet. In this session we’ll look at the tools that can help you understand, measure and improve the web performance of your web sites and applications. The talk will also discuss how new server-side techniques might help us optimize our front-end performance. Finally, since the best way to test is to have devices in your hand, we’ll discuss some tips for getting your hands on them cheaply.

web performanceresponsive web designmobile
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.

Recommended for you

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

We all know that site speed matters not only for users but also for search rankings. As marketers, how can we measure and improve the impact of site speed? Mat will cover a range of topics and tools, from the basic quick wins to some of the more surprising and cutting-edge techniques used by the largest websites in the world.

searchlovesearchlove san diegosite speed
Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013

The document discusses performance testing plans for a website. It proposes using synthetic testing from 14 global locations on representative pages every 5 minutes. A new plan tests from last-mile locations on desktop and mobile with 20 daily samples. Custom timing marks will measure user experience, sent to analytics. Synthetic testing will also run in continuous integration to catch performance regressions early.

webperfwebpagetest
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

Devices are as unique as their users. Detecting the end user’s platform is a fruitless expenditure that often leads to wrong assumptions. Maintaining multiple web applications for different platforms is not cost effective and stressful. Responsive web design is a way to design your applications for devices of all shapes, sizes and resolutions. This session covers a definition, examples and how to execute a proper mobile first responsive design. We will also cover how to use responsive images to ensure your application performs well.

html5responsive imagesweb design and development
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?

Recommended for you

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

This document discusses different methods for measuring website performance from both a synthetic and real-user perspective. It introduces the Speed Index metric for quantifying visual progress and compares the Speed Index of Amazon and Twitter. It also covers the Chrome resource prioritization and different challenges around visual performance metrics.

web performance
Selecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutionsSelecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutions

This document discusses various methods for automating front-end optimization. It describes how HTML rewriting solutions can optimize HTML through proxies or in-app plugins. It also discusses when certain optimizations are best done by machines versus humans. The document outlines different architectures for front-end optimization solutions, including cloud-based and on-premises options, and considers when each is most appropriate. It emphasizes the importance of testing solutions before deploying and of monitoring performance after deployment.

webperf
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

Progressive Web Applications (PWA) is a comprehensive term describing web applications that implement a base set of browser platform features like HTTPS, Web Manifest and Service Workers. But it bleeds beyond the scope of an application's code because browsers are enabling qualified web applications to offer the same user experiences native application enjoy. This includes prominent home screen placement, push notifications, eliminated browser chrome and app store placement. Become a Progressive Web App expert with my course: Progressive Web Apps (PWA) Beginner to Expert -> http://PWACourse.com

businesstechnologyprogressive web applications
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

Recommended for you

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

The document discusses responsive web design and strategies for creating websites that adapt to different screen sizes. It recommends taking a mobile-first approach, using fluid layouts and media queries to make content responsive. Key tips include starting small and resizing the browser, using Chrome's device mode to emulate different devices, and the matchMedia API to bind JavaScript to breakpoints. The overall goal is to provide an optimal viewing experience across all devices.

responsive web designhtml5mobile web
Hacking Web Performance @ ForwardJS 2017
Hacking Web Performance @ ForwardJS 2017Hacking Web Performance @ ForwardJS 2017
Hacking Web Performance @ ForwardJS 2017

Talk about Web Performance and what to do after the basics taking place at ForwardJS 2017 in San Francisco, USA.

mobile webweb performance
Happy facebook developer
Happy facebook developerHappy facebook developer
Happy facebook developer

This document provides an overview of Facebook development including: - A brief history of Facebook and key user statistics over time - The technologies used in Facebook development including JavaScript, PHP, and Facebook's Graph API - How to integrate a website or application with Facebook through features like Social Plugins, Single Sign-On, and the Open Graph Protocol - Building applications within Facebook including Canvas apps, apps on Facebook.com, and using the Facebook JavaScript SDK

developerapiapis
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

Recommended for you

Facebook App Development
Facebook App DevelopmentFacebook App Development
Facebook App Development

A little talk I gave at BarCamp Liverpool on how to get started with Facebook Apps. Totally out of date by now (2013).

bcliverpoolbarcampdevelopment
Facebook Development with Zend Framework
Facebook Development with Zend FrameworkFacebook Development with Zend Framework
Facebook Development with Zend Framework

The document discusses developing Facebook applications using the Zend Framework. It covers challenges like publicly accessible development environments and differences from normal web development. It also describes using a proxy pattern to mock Facebook APIs locally and parsing FBML tags. The document advocates using an active record pattern to access Facebook data and building UI components to wrap AJAX libraries for multi-application interfaces.

zendcon08zendconfacebook
Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)

New version of Introduction to Facebook Javascript SDK More focus on implementation Social Network and Applications - TA Session LittleQ

javascriptfacebook
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

Recommended for you

Workshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKWorkshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDK

The document provides an overview of the Facebook JavaScript SDK. It discusses loading and initializing the SDK, using it to check login status and perform login, subscribing to events, and making API calls to Facebook for user data and to post to Facebook. The SDK enables using Facebook features like the Like button and Login in websites and accessing the Graph API and FQL from JavaScript.

facebook javascript sdkfacebookfacebook javascript
Introduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDKIntroduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDK

This document provides an outline for a tutorial on the facebook JavaScript SDK. It introduces the SDK and covers the following topics: - An overview of the Facebook developer site, apps, components, and authentication process - Technical details of the SDK, including how to use the Graph API, callbacks, and RESTful API model - Facebook developer tools like the Graph API explorer and access token tool - A code lab section that provides examples of integrating the SDK, authenticating users, accessing the Graph API, and using social plugins and dialogs

facebookgraph apidevelop
Introduction to facebook java script sdk
Introduction to facebook java script sdk Introduction to facebook java script sdk
Introduction to facebook java script sdk

This document provides an overview and tutorial on using the Facebook JavaScript SDK. It begins with essential knowledge on the Facebook developers website, Facebook apps, the JavaScript SDK and Graph API. It then covers technical details like downloading the SDK, login functions, the Graph API, sharing, and social plugins. The final section demonstrates implementation through checkpoints for setting up a basic app, login, fetching a user's profile picture and name, and enabling sharing and comments. The goal is to teach developers how to integrate Facebook login, access user data, and allow sharing through the JavaScript SDK.

facebooksdk
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:

Recommended for you

Introduction to facebook javascript sdk
Introduction to facebook javascript sdk Introduction to facebook javascript sdk
Introduction to facebook javascript sdk

This document provides instructions for implementing Facebook login and sharing functionality using the Facebook JavaScript SDK. It begins with an overview of essential knowledge including the Facebook developers website, Facebook apps, the JavaScript SDK, and Graph API. It then covers technical details such as downloading the SDK, login processes, calling the Graph API and sharing methods. Finally, it outlines an implementation plan involving setting up the environment, integrating static files into Django, using a database in Django, implementing Facebook login, and enabling sharing and friend lists. The goal is to guide developers through setting up a social media application that utilizes the Facebook platform.

tutorialfacebookweb2.0
Facebook + Ruby
Facebook + RubyFacebook + Ruby
Facebook + Ruby

An introduction to developing for Facebook using Ruby and the Koala gem, presented to the Ruby Users Group in Munich in December 2010.

railsfacebookruby
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

This is a story about how Groupon's business was changing and our technology couldn't keep up. We rewrote the web site using node.js and changed the way our company and culture.

cssrubyhtml
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

Recommended for you

Keynote I
Keynote IKeynote I
Keynote I

From the Venetian Hotel in Las Vegas, Ray Ozzie, Chief Software Architect, will be joined by Corporate Vice President, Scott Guthrie and General Manager, Dean Hachamovitch to demonstrate the latest technologies built for Microsoft's Web platform. Ray will lay out his vision of the future to this audience of Web designers and developers from around the world

mix09keynote
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

The document discusses Project Zero, an open source development framework that aims to simplify Web 2.0 application development using dynamic scripting languages like Groovy and PHP. Project Zero provides a full-stack runtime environment, built-in development tools, and supports the creation of RESTful services and Ajax applications. Developers can get started with Project Zero by downloading its developer version, which includes the WebSphere sMash runtime and AppBuilder IDE.

projectzeroweb20development
Entwicker camp2007 blackberry-workshop
Entwicker camp2007 blackberry-workshopEntwicker camp2007 blackberry-workshop
Entwicker camp2007 blackberry-workshop

The document discusses how to enable Domino applications to be accessed from BlackBerry devices by web service enabling Domino applications and developing mobile applications using the BlackBerry MDS Studio; it provides an overview of the necessary architectures and components and outlines lessons for web service enabling a simple Domino application and developing a more complex mobile application.

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

Recommended for you

Chicago from the Cloud
Chicago from the CloudChicago from the Cloud
Chicago from the Cloud

Fred Lebolt, Senior Vice President of Sun-Times Media, gave a presentation about how the company transitioned to a cloud-based content management system. The summary is: 1) Sun-Times Media consolidated its content, advertising, and publishing systems onto a single cloud-based platform to improve collaboration across its 40 newspapers. 2) This allowed the newspapers to share content more easily across multiple platforms and locations, including editing pages remotely. 3) The transition enabled Sun-Times Media to launch new digital products like mobile apps and e-readers.

mediaport 2011ifra expo
HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09

This document discusses HTML5 capabilities and their implementation in Google Chrome. It describes new HTML5 features like <canvas>, <video>, local storage, and workers. It notes that these features allow web applications to have capabilities that previously required native apps. The document demonstrates several new HTML5 features and discusses ongoing work to further expand web application capabilities in areas like geolocation, 3D graphics, and additional APIs. It positions Google Chrome as a browser that provides native support for emerging HTML5 capabilities.

devfest09
Station Four: Web Redesign Presentation
Station Four: Web Redesign PresentationStation Four: Web Redesign Presentation
Station Four: Web Redesign Presentation

Presenting the 2012 Station Four web redesign to AIGA's morning leak. The presentation reviews the design, site structure, and technologies involved.

webdesign redesign design branding graphicdesign
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

Recommended for you

Akamai 如何幫您的客戶用網站賺錢 how to monetize your site
Akamai 如何幫您的客戶用網站賺錢 how to monetize your siteAkamai 如何幫您的客戶用網站賺錢 how to monetize your site
Akamai 如何幫您的客戶用網站賺錢 how to monetize your site

The document discusses how Akamai's Dynamic Site Accelerator (DSA) can help websites address performance, scalability, security, and availability issues. DSA leverages Akamai's global edge network to speed page loading, optimize caching, improve TCP performance, and offload website infrastructure. It provides an example of how DSA helped Cathay Pacific boost online bookings and reduce infrastructure costs. In summary, DSA leverages Akamai's edge network to improve website performance, scalability, and availability while reducing infrastructure needs and costs.

akamai technologies零壹科技dsa
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

This document summarizes a presentation given by Deb Woods and Binesh Gummadi at Red Hat Summit 2009 about using open source technologies at Facebook. It discusses Ingres' mission and products, how open standards and open source can reduce costs and increase flexibility. It also outlines how the Wedding Planning application for Facebook was developed using JBoss, Ingres, Alfresco, and other open source technologies to provide benefits like reduced costs, performance, and time to market. The presentation covers architecture details and APIs for technologies like JBoss Seam, Facebook, Alfresco, and Crafter.

facebookingresredhat
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

Yottaa provides a performance cloud product that helps websites and mobile apps optimize for web performance beyond just content delivery networks (CDNs). The document discusses 5 forces transforming web performance: the explosion of mobile, more complex websites, the rise of social media, a complex application delivery chain, and the importance of performance for user engagement. It outlines problems like front-end bottlenecks and large/serial asset delivery that impact performance and discusses Yottaa solutions like just-in-time rendering, federated CDNs, and device-specific optimizations. A case study shows how Yottaa helped the Brit Awards website improve user experience by 50% and reduce infrastructure load by 97% during traffic spikes.

cdnapplication perwebsite acceleration
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

Recommended for you

Web performance e-book
Web performance e-bookWeb performance e-book
Web performance e-book

The document discusses optimizing website performance for designers. It begins by explaining how front-end assets like HTML, CSS, JavaScript and images account for 80-90% of page load time. It then discusses common causes of poor performance like too many requests, large file sizes, and too many assets. The rest of the document provides strategies for optimizing assets, such as combining files, minifying code, using CSS sprites for images, and optimizing loading order. The overall goal is reducing page size and number of requests to improve load times.

performancee-bookweb
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

The document discusses key reasons for poor web performance and how designers can improve it. It identifies that the front-end assets created by designers, such as HTML, CSS, JavaScript and images, account for 80-90% of page load time. Reducing the number of requests by combining files and reducing file sizes are the most impactful ways for designers to optimize performance. Large numbers of assets and large file sizes are the primary culprits of slow load times.

web designsite speedseo
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

The document discusses key reasons for poor web performance and how designers can improve it. It identifies that the front-end assets created by designers, such as HTML, CSS, JavaScript and images, account for 80-90% of page load time. Reducing the number of requests by combining files and reducing file sizes are the most impactful ways for designers to optimize performance. Large numbers of assets and large file sizes are the primary culprits of slow load times.

web designweb performance optimizationuser experience
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

Recommended for you

Mobile Performance Testing - Testing the Server
Mobile Performance Testing  - Testing the ServerMobile Performance Testing  - Testing the Server
Mobile Performance Testing - Testing the Server

This document discusses testing the server side performance of mobile websites. It begins with introducing the importance and challenges of mobile performance testing. It then outlines an agenda covering differences between mobile and desktop usage, steps to take in testing including simple comparison, performance and load tests, and optimization strategies. Specifically, it recommends starting with basic tests to compare a site on desktop vs mobile, then using tools like WebPagetest to analyze performance, and finally gradually increasing load on servers. The overall goal is to help organizations prevent mobile performance issues through early and frequent testing.

mobile performance testing
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...

Customers expect great online experiences — and the bar gets higher every day. Today's consumers are web savvy; they expect blazing fast performance and the highest-quality experiences no matter what site they’re visiting. If they have to wait too long for a page to load they will abandon the site for the competition. Join Web performance experts from Gomez and Forrester Research, Inc. at this complimentary webinar to learn how to get 3 second response times from your Website, improve availability, and deliver better customer experiences. Attendees at this webinar will learn: 1. How to take advantage of the latest caching technologies so that you can cache smart and cache often 2. Best practices to minimize the impact of browser diversity on web application performance 3. How to architect your pages for raw speed and perceived performance to ensure top performance 4. Tips on how Infrastructure Operations and Marketing can partner for performance 5. Diagnostic best practices to find where performance optimization opportunities exist

javascript speedwebsite performanceweb 20
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

This document provides an overview of how to deploy Domino applications to BlackBerry devices using BlackBerry MDS Studio. It discusses the target audience, architectures, enabling a Domino application as a web service, installing MDS Studio, an overview of the MDS Studio interface, steps for a first simple application, and considerations for more complex applications. The presentation guides developers through creating a web service in Domino, consuming it using Java code, and building a basic BlackBerry app in MDS Studio to retrieve data from the web service and display it. It also offers tips for improving the initial sample application.

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

Recommended for you

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

The document outlines a 4 day training on web 2.0 application development using Ruby on Rails, including an introduction to concepts like MVC, REST, and AJAX; it describes building a sample quiz application on the first two days to learn Rails fundamentals and then enhancing it with JavaScript, jQuery, and other technologies on days 3 and 4. Key topics to be covered include setting up Ruby and Rails, the architecture of web applications, an overview of Ruby programming concepts, and hands-on exercises to develop real applications.

web20rubyonrails
App Engine Overview Cloud Futures Publish
App Engine Overview Cloud Futures PublishApp Engine Overview Cloud Futures Publish
App Engine Overview Cloud Futures Publish

This is a presentation on Google App Engine given at the Cloud Futures 2010 conference in Seattle hosted by Microsoft Research.

javagooglepython
Put the client on the client
Put the client on the clientPut the client on the client
Put the client on the client

Put the client on the client - thin servers and rich clients on the Open Web Presented at CommunityOne North in Oslo, 2009-04-15

communityoneopenwebdojo
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

Recommended for you

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

If you are a developer or business manager with responsibilities over your website, then check out this deck.. What will you learn? The webinar, created by our Founder and CEO, Andy Kucharski, is a highly accessible, information-rich review on the ways Drupal site performance can be radically improved. Some of the main topics we will cover include: What is slow site speed? What tools to use to diagnose it. Plus six key improvements to make Drupal “run fast!” And if that’s not already enough, we will also share some best practices monitoring tips for making sure you know how the Drupal server is performing 24/7.

drupalfront end performancecaching
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf

These fighter aircraft have uses outside of traditional combat situations. They are essential in defending India's territorial integrity, averting dangers, and delivering aid to those in need during natural calamities. Additionally, the IAF improves its interoperability and fortifies international military alliances by working together and conducting joint exercises with other air forces.

air force fighter planebiggest submarinezambia port
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant

Password Rotation in 2024 is still Relevant

passwordmanagementrotation
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

Recommended for you

Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM

Quantum Communications Q&A with Gemini LLM. These are based on Shannon's Noisy channel Theorem and offers how the classical theory applies to the quantum world.

quantum communicationsshannon's channel theoremclassical theory
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx

How do we build an IoT product, and make it profitable? Talk from the IoT meetup in March 2024. https://www.meetup.com/iot-sweden/events/299487375/

iot
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx

MuleSoft Meetup on APM and IDP

mulesoftai
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

Recommended for you

Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy

Not so much to say

Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection

Cybersecurity is a major concern in today's connected digital world. Threats to organizations are constantly evolving and have the potential to compromise sensitive information, disrupt operations, and lead to significant financial losses. Traditional cybersecurity techniques often fall short against modern attackers. Therefore, advanced techniques for cyber security analysis and anomaly detection are essential for protecting digital assets. This blog explores these cutting-edge methods, providing a comprehensive overview of their application and importance.

cybersecurityanomaly detectionadvanced techniques
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...

Today’s digitally connected world presents a wide range of security challenges for enterprises. Insider security threats are particularly noteworthy because they have the potential to cause significant harm. Unlike external threats, insider risks originate from within the company, making them more subtle and challenging to identify. This blog aims to provide a comprehensive understanding of insider security threats, including their types, examples, effects, and mitigation techniques.

insider securitycybersecurity threatsenterprise security
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

Recommended for you

Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems

Stream processing is a crucial component of modern data infrastructure, but constructing an efficient and scalable stream processing system can be challenging. Decoupling compute and storage architecture has emerged as an effective solution to these challenges, but it can introduce high latency issues, especially when dealing with complex continuous queries that necessitate managing extra-large internal states. In this talk, we focus on addressing the high latency issues associated with S3 storage in stream processing systems that employ a decoupled compute and storage architecture. We delve into the root causes of latency in this context and explore various techniques to minimize the impact of S3 latency on stream processing performance. Our proposed approach is to implement a tiered storage mechanism that leverages a blend of high-performance and low-cost storage tiers to reduce data movement between the compute and storage layers while maintaining efficient processing. Throughout the talk, we will present experimental results that demonstrate the effectiveness of our approach in mitigating the impact of S3 latency on stream processing. By the end of the talk, attendees will have gained insights into how to optimize their stream processing systems for reduced latency and improved cost-efficiency.

WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf

Profile portofolio

20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf

Support en anglais diffusé lors de l'événement 100% IA organisé dans les locaux parisiens d'Iguane Solutions, le mardi 2 juillet 2024 : - Présentation de notre plateforme IA plug and play : ses fonctionnalités avancées, telles que son interface utilisateur intuitive, son copilot puissant et des outils de monitoring performants. - REX client : Cyril Janssens, CTO d’ easybourse, partage son expérience d’utilisation de notre plateforme IA plug & play.

genaicloudrgpd

More Related Content

What's hot

Browser Based Performance Testing and Tuning
Browser Based Performance Testing and TuningBrowser Based Performance Testing and Tuning
Browser Based Performance Testing and Tuning
Bala Murali Krishna Kanchukambala
 
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 2016
Chris Love
 
A Modern Approach to Performance Monitoring
A Modern Approach to Performance MonitoringA Modern Approach to Performance Monitoring
A Modern Approach to Performance Monitoring
Cliff 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 Challenges
Jason Grigsby
 
Measuring what matters
Measuring what mattersMeasuring what matters
Measuring what matters
Cliff 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 Elimelech
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...
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 good
Chris 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 Handles
Chris 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 Marketers
Distilled
 
Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013
Patrick 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 - Updated
Chris 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 performance
Patrick Meenan
 
Selecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutionsSelecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutions
Patrick 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 applications
Chris 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 Everywhere
Chris Love
 
Hacking Web Performance @ ForwardJS 2017
Hacking Web Performance @ ForwardJS 2017Hacking Web Performance @ ForwardJS 2017
Hacking Web Performance @ ForwardJS 2017
Maximiliano Firtman
 

What's hot (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
 

Viewers also liked

Happy facebook developer
Happy facebook developerHappy facebook developer
Happy facebook developer
Yu-Wei Chuang
 
Facebook App Development
Facebook App DevelopmentFacebook App Development
Facebook App Development
Cristiano Betta
 
Facebook Development with Zend Framework
Facebook Development with Zend FrameworkFacebook Development with Zend Framework
Facebook Development with Zend Framework
Brett 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 SDK
Dimitar Danailov
 
Introduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDKIntroduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDK
Colin 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
 
Facebook + Ruby
Facebook + RubyFacebook + Ruby
Facebook + Ruby
Alex Koppel
 

Viewers also liked (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
 

Similar to 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 Monolith
Sean McCullough
 
Keynote I
Keynote IKeynote I
Keynote I
goodfriday
 
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
Shawn Zhu
 
Entwicker camp2007 blackberry-workshop
Entwicker camp2007 blackberry-workshopEntwicker camp2007 blackberry-workshop
Entwicker camp2007 blackberry-workshop
Bill Buchan
 
Chicago from the Cloud
Chicago from the CloudChicago from the Cloud
Chicago from the Cloud
WAN-IFRA
 
HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09
mihaiionescu
 
Station Four: Web Redesign Presentation
Station Four: Web Redesign PresentationStation Four: Web Redesign Presentation
Station Four: Web Redesign Presentation
colberding
 
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
Binesh 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 Performance
Yottaa
 
Web performance e-book
Web performance e-bookWeb performance e-book
Web performance e-book
Cristiano Caetano
 
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
Luis Alejandro Ramírez Gallardo
 
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
Kevin Mandeville
 
Mobile Performance Testing - Testing the Server
Mobile Performance Testing  - Testing the ServerMobile Performance Testing  - Testing the Server
Mobile Performance Testing - Testing the Server
XBOSoft
 
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 Studio
Bill 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 Rails
Amit Mathur
 
App Engine Overview Cloud Futures Publish
App Engine Overview Cloud Futures PublishApp Engine Overview Cloud Futures Publish
App Engine Overview Cloud Futures Publish
Chris Schalk
 
Put the client on the client
Put the client on the clientPut the client on the client
Put the client on the client
André 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 Drupal
Andy Kucharski
 

Similar to 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
 

Recently uploaded

INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
Bert Blevins
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Bert Blevins
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
Sally Laouacheria
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 

Recently uploaded (20)

INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.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