SlideShare une entreprise Scribd logo
1  sur  102
Télécharger pour lire hors ligne
‫נעים להכיר ...‬
‫‪ ‬חברה המתמחה במתן שירותים בתחום ניהול ביצועי מערכות‬
                     ‫בכלל ומערכות מבוססות דפדפן בפרט‬
‫‪ ‬מנהלי ‪Israel Web Performance Optimization meetup‬‬
           ‫‪ ‬נציגי, מטמיעי ומפתחי פתרונות תוכנה בתחומים:‬
                                        ‫‪ ‬האצת אתרים‬
                          ‫‪ ‬ניטור ואיתור תקלות בזמן אמת‬
                         ‫‪www.efficens-software.com ‬‬
                                     ‫‪Twitter: efficens ‬‬
                      ‫‪ :Facebook ‬אפיסנס סופטוור בע"מ‬
                      ‫‪http://www.meetup.com/wpo-il ‬‬
‫בתוכנית היום‬
 What is Web Performance

 How does Web Performance affects our bottom line

 The web Performance building blocks

 Knowing your audience: understanding Browser behaviors

 Measuring Performance using YSlow and Google PageSpeed

 Understanding Waterfalls

 Working with WebPageTest

 Working with DynaTrace Ajax Edition

 JavaScript and you
‫"הזמן הנתפס על ידי המבקר באתר‬
    ‫בין פעולה (כמו לחיצה) עד לתגובה‬
             ‫משמעותית"‬

‫‪Stephan Thair, Seriti consulting‬‬
‫תפיסת הזמן‬




http://velocityconf.com/velocity2010/public/schedule/detail/13019
‫איטיות והמוח שלנו‬
“Brain wave analysis from the
  experiment       revealed  that
  participants had to concentrate
  up to 50% more when using
  badly performing websites,
  while     facial   muscle  and
  behavioural analysis of the
  subjects also revealed greater
  agitation and stress in these
  periods.
http://www.ca.com/Files/SupportingPieces/final_webstr
    ess_survey_report_229296.pdf
10
     Performanc
               e            5
    improvemen                                                                      6 secs   8 secs
                                        2 secs                 4 secs
     t (seconds)            0

                           -5            -8%

                         -10
                                                               -25%
                         -15
                                                                                    -33%
     Percentage
       change in         -20                                                                 -38%
           page
     abandonme           -25
              nt
                         -30

                         -35

                         -40
urce: Gomez 2010 Study of 500 Million End-User Interactions Across 200+ Web Sites
http://www.webperformancetoday.com/2010/06/22/the-90-minute-optimization-life-cycle-faster-by-default-before-our-eyes/
http://www.webperformancetoday.com/2010/06/22/the-90-minute-optimization-life-cycle-faster-by-default-before-our-eyes/
http://www.webperformancetoday.com/2010/06/22/the-90-minute-optimization-life-cycle-faster-by-default-before-our-eyes/
‫מהם ביצועים טובים ?‬
               ‫1.0 שניות נותן תחושה של תגובה מיידית‬                ‫‪‬‬
        ‫1 שניה מונע הסחת דעת ומאפשרת רצף מחשבתי‬                    ‫‪‬‬
                ‫01 שניות שומרות על תשומת לב הגולש‬                  ‫‪‬‬
 ‫8 שניות הוא הזמן הממוצע שלוקח לגולש לקבל החלטה האם‬                ‫‪‬‬
                    ‫הוא נשאר בדף או עובר למקום אחר‬
‫‪Jakob Neilsen. http://www.useit.com/alertbox/response-times.html‬‬
Web performance anatomy
                                        Latency

                        HTTP AJAX/XHR
      IE
 Firefox
Chrome       Browser                     Internet    Server
  Safari
 Opera

              Images
                 CSS
           JavaScript   Cache
                Flash



             Parsing                     DNS        3rd-party
           Layouting                    Server       servers
           Rendering
‫מרכיבי זמן התגובה‬
                                             ‫קריטי ליישומי‬
                                               ‫0.2 ‪Web‬‬




‫‪Server side‬‬       ‫‪Content delivery‬‬        ‫‪Rendering‬‬


                 ‫מחוץ למסגרת המערכת אבל‬
                      ‫עדיין באחריותנו‬



       ‫%09-08 מהזמן נצרך מחוץ לגבולות השרת‬
                                                             ‫91‬
Bandwidth & Latency
‫הורדת ‪ 200KB‬בקווי‬
     ‫‪1.5Mb/Sec‬‬
    ‫אורכת כשנייה‬
‫לא הבטיחו לנו ממשק אחיד, פשוט ורזה ?‬
It’s a Multi-Browser World: Different for Each
                             Customer Base




Source: http://arstechnica.com/web/news/2011/02/chrome-takes-10-usage-share-ie-continues-to-haemorrhage.ars; http://gs.statcounter.com/#browser_version-ww-monthly-201001-201101
Load Time       Perceived Render
          25


          20


          15
Seconds




          10


           5


           0




               Source: Gomez Real-User Monitoring
                  Real users around the world        466 million page measurements
                  Broadband connections only         200+ sites
Fragmented,        • Who is #1 today? Tomorrow?
rapidly-changing                                                      7
market             • Who is #1 with your customers?          6
                                                                  8



Different          • Number of parallel connections
operational        • JavaScript processing
characteristics    • Etc.

                                                       Browser
Processing         • Percentage of total
moving to the                                          Network
browser              response time
                                                       Infrastructure


                   • Performance
Major impact on    • Functionality
user experience
                   • Appearance
? ‫מה מודדים‬
                     ‫• בדיקות מבוססות זמן‬
                  Time to first byte •
          Time to first impression •
                            onLoad •
                 Fully loaded time •

‫• "ציוני תקן" המבוססים על מתודולוגיות ידועות‬
                      Yahoo! YSlow •
               Google Page Speed •
          dynaTrace AJAX edition •
 Minimize HTTP Requests                            Remove Duplicate Scripts
  Use a Content Delivery Network                    Configure ETags
  Add an Expires or a Cache-                        Make AJAX Cacheable
   Control Header
                                                     Use GET for AJAX Requests
  Gzip Components
                                                     Reduce the Number of DOM
  Put StyleSheets at the Top                         Elements
  Put Scripts at the Bottom                         No 404s
  Avoid CSS Expressions                             Reduce Cookie Size
  Make JavaScript and CSS                           Use Cookie-Free Domains for
   External                                           Components
  Reduce DNS Lookups                                Avoid Filters
  Minify JavaScript and CSS                         Do Not Scale Images in HTML
  Avoid Redirects                                   Make favicon.ico Small & Cacheable

http://developer.yahoo.com/yslow/help/#guidelines
 Avoid bad requests                                           Minimize redirects

   Avoid CSS expressions                                        Optimize images

   Combine external CSS                                         Optimize the order of styles and
                                                                  scripts
   Combine external JavaScript
                                                                 Parallelize downloads across
   Defer loading of JavaScript                                   hostnames
   Enable compression                                           Put CSS in the document head
   Leverage browser caching                                     Remove unused CSS
   Leverage proxy caching                                       Serve resources from a consistent
   Minify CSS                                                    URL

   Minify HTML                                                  Serve scaled images

   Minify JavaScript                                            Serve static content from a
                                                                  cookieless domain
   Minimize request size
                                                                 Specify a character set early
   Minimize DNS lookups
                                                                 Specify image dimensions
http://code.google.com/speed/page-speed/docs/rules_intro.html
                                                                 Use efficient CSS selectors
? ‫מה חשוב‬




http://www.httpArchive.org
? ‫מה חשוב‬




http://www.httpArchive.org
‫מהירות טעינה‬   ‫מספר בקשות‬   YSLOW ‫ציון‬   PS ‫ציון‬    ‫שם האתר‬


   2.258           4            94         77      Roninsight


   8.042           8            92         88      Roninsight
                                                        (WP)

   4.05           90            74         76        ionroad


  22.856          149           70         64          ELAL


   13.29          53            73         83          rompr
? ‫רוצים עוד‬
              Http KeepAlive   •
              Async JS Load    •
              DOM Elements     •
                       CDN     •
http://www.efficens-software.com/2011/07/understanding_waterfall_charts/
Webmaster Tools           Google Analytics
 What is measured       Time from Initial Page Request to “Document
                                          Complete”
 How it’s measured      Google Toolbar       Navigation Timing + Google
                                                    Toolbar on IE
Browsers measured          Firefox 2-4                    IE 9+
                              IE 6-9                  Chrome 6+
                     with Google Toolbar &             Firefox 7+
                      PageRank Enabled                Android 4+
                                              IE 6-8 with Google Toolbar
   Sampling rate      All Clients (assumed)   1% of clients, max 10K/day

Averaging techniques 7-day running weighted     30-day simple average
                     average (popular pages     (average the individual
                          matter more)        page’s average load times(
https://developers.google.com/pagespeed/
‫על מה להסתכל ?‬
http://www.gomez.com/instant-test-pro/
What’s the #1
cause of slow
web pages?
JAVASCRIPT!
JavaScript performance
         directly
affects user experience
The browser UI thread is responsible for
both UI updates and JavaScript execution
           Only one can happen at a time
<button id="btn" style="font-size: 30px; padding: 0.5em
1em">Click Me</button>

<script type="text/javascript">
window.onload = function(){
   document.getElementById("btn").onclick = function(){
       //do something
   };
};
</script>
Before Click
UI Thread




time
                  UI Queue
When Clicked
UI Thread




time
                  UI Queue

                    UI Update

                    onclick

                    UI Update
When Clicked
UI Thread

 UI Update

time
                          UI Queue

                            onclick
        Draw down state
                            UI Update
When Clicked
UI Thread

 UI Update   onclick

time
                       UI Queue

                         UI Update
When Clicked
UI Thread

 UI Update   onclick       UI Update

time
                                       UI Queue


               Draw up state
No UI updates while
JavaScript is executing
Loadtime Techniques
Don't let JavaScript interfere with page load performance
<!doctype html>
<html>
<head>
    <title>Example</title>
</head>
<body>
    <p>Hello world!</p>
    <script src="foo.js"></script>
    <p>See ya!</p>
</body>
</html>
Result
UI Thread

 Hello world!   Download   Parse   Run   See ya!

time




  The UI thread needs to wait for the script to
  download, parse, and run before continuing
Translation:
The page doesn't render while
JavaScript is downloading,
parsing, or executing during
page load
Result
UI Thread

 JavaScript   UI Update   JavaScript   UI Update   JavaScript


time



  The more scripts to download in between UI
  updates, the longer the page takes to render
Technique #1: Load scripts
dynamically
Basic Technique
var script = document.createElement("script"),
    body;
script.type = "text/javascript";
script.src = "foo.js";
body.insertBefore(script, body.firstChild);




Dynamically loaded scripts are non-blocking
Downloads no longer block
the UI thread
Using Dynamic Scripts
UI Thread

 Hello world!   See ya!            Run   UI Update

time


                Download   Parse




Only code execution happens on the UI thread,
   which means less blocking of UI updates
function loadScript(url, callback){

var script = document.createElement("script"),
    body = document.body;
script.type = "text/javascript";

if (script.readyState){ //IE <= 8
    script.onreadystatechange = function(){
        if (script.readyState == "loaded" ||
                script.readyState == "complete"){
            script.onreadystatechange = null;
            callback();
        }
    };
} else { //Others
    script.onload = function(){
        callback();
    };
}

script.src = url;
body.insertBefore(script, body.firstChild);

}
Usage

loadScript("foo.js", function(){
      alert("Loaded!");
});
Timing Note:
Script execution begins
immediately after download
and parse – timing of
execution is not guaranteed
Technique #2: Defer scripts
<!doctype html>
<html>
<head>
    <title>Example</title>
</head>
<body>
    <p>Hello world!</p>
    <script defer src="foo.js"></script>
    <p>See ya!</p>
    <!-- even more markup -->
</body>
</html>
Support for <script defer>




3.5   7.0   5.0    4.0       ?
Deferred scripts begin to
download immediately,
but don't execute until all UI
updates complete
Using <script defer>
UI Thread

 Hello world!   See ya!    More UI   More UI   Run




time


                Download     Parse




   Similar to dynamic script nodes, but with a
    guarantee that execution will happen last
Timing Note:
   Although scripts always
   execute after UI updates
complete, the order of multiple
  <script defer> scripts is not
 guaranteed across browsers
Technique #3: Asynchronous
scripts
<!doctype html>
<html>
<head>
    <title>Example</title>
</head>
<body>
    <p>Hello world!</p>
    <script async src="foo.js"></script>
    <p>See ya!</p>
    <!-- even more markup -->
</body>
</html>
Support for <script async>




3.6   7.0   5.0    10    ?
Using <script async>
UI Thread

 Hello world!   See ya!            Run   UI Update

time


                Download   Parse




Download begins immediately and execution is
      slotted in at first available spot
Note:
Order of execution is explicitly
      not preserved for
   asynchronous scripts
Timers
//create a new timer and delay by 500ms
  setTimeout(function(){


      //code to execute here


  }, 500);




setTimeout() schedules a function
to be added to the UI queue after
a delay
Web Workers
Support for Web Workers




3.5   4.0   4.0   10 10.6
Web Workers
 Asynchronous JavaScript execution
 Execution happens outside the UI thread
    Doesn’t block UI updates
 Data-Driven API
    Data is serialized going into and out of the worker
    No access to DOM or BOM
    Separate execution environment
‫כלים - סיכום‬
 Google Page Speed Tools Family
       http://code.google.com/speed/page-speed/
 dynaTrace AJAX Edition
       http://ajax.dynatrace.com/ajax/en/
 Yahoo! YSlow
       http://developer.yahoo.com/yslow/
 WebPagetest
       http://www.webpagetest.org/
 Show Slow
        http://www.showslow.com/
 Let's Make the Web Faster
       http://code.google.com/intl/en-EN/speed/tools.html
 Books
    - High Performance Web Sites
    - Even Faster Web Sites
    - Website Optimization
    - Complete Web Monitoring
    -High Performance JavaScript
gil@efficens-software.com
       054-2552060
         @efficens

Contenu connexe

Tendances

Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Nicholas Zakas
 
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...David Kaneda
 
Belgrade when its just too slow
Belgrade when its just too slowBelgrade when its just too slow
Belgrade when its just too slowDoug Sillars
 
Nantes when its just too slow
Nantes when its just too slowNantes when its just too slow
Nantes when its just too slowDoug Sillars
 
HTML5 APIs - Where No Man Has Gone Before - StarTechConf, Chile
HTML5 APIs - Where No Man Has Gone Before - StarTechConf, ChileHTML5 APIs - Where No Man Has Gone Before - StarTechConf, Chile
HTML5 APIs - Where No Man Has Gone Before - StarTechConf, ChileRobert Nyman
 
Performance Implications of Mobile Design
Performance Implications of Mobile DesignPerformance Implications of Mobile Design
Performance Implications of Mobile DesignGuy Podjarny
 
Scaling Drupal: Not IF... HOW
Scaling Drupal: Not IF... HOWScaling Drupal: Not IF... HOW
Scaling Drupal: Not IF... HOWTreehouse Agency
 
High Performance Websites
High Performance WebsitesHigh Performance Websites
High Performance WebsitesAaron Grogg
 
Velocity 2012: The 90-Minute Mobile Optimization Life Cycle
Velocity 2012: The 90-Minute Mobile Optimization Life CycleVelocity 2012: The 90-Minute Mobile Optimization Life Cycle
Velocity 2012: The 90-Minute Mobile Optimization Life CycleStrangeloop
 
[Challenge:Future] Chocoholic
[Challenge:Future] Chocoholic [Challenge:Future] Chocoholic
[Challenge:Future] Chocoholic Challenge:Future
 
Adaptive Web Design Workshop [inspire 2011]
Adaptive Web Design Workshop [inspire 2011]Adaptive Web Design Workshop [inspire 2011]
Adaptive Web Design Workshop [inspire 2011]Aaron Gustafson
 
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web [Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web Shreeraj Shah
 
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]Aaron Gustafson
 
IBM Connect 2016 - AD1548 - Building Responsive XPages Applications
IBM Connect 2016 - AD1548 - Building Responsive XPages ApplicationsIBM Connect 2016 - AD1548 - Building Responsive XPages Applications
IBM Connect 2016 - AD1548 - Building Responsive XPages Applicationsbeglee
 
Front End page speed performance improvements for Drupal
Front End page speed performance improvements for DrupalFront End page speed performance improvements for Drupal
Front End page speed performance improvements for DrupalAndy Kucharski
 
Aptimize SharePoint Datasheet
Aptimize SharePoint DatasheetAptimize SharePoint Datasheet
Aptimize SharePoint DatasheetArmand Sultantono
 
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011Peter Moskovits
 

Tendances (19)

Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
 
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
 
Belgrade when its just too slow
Belgrade when its just too slowBelgrade when its just too slow
Belgrade when its just too slow
 
Nantes when its just too slow
Nantes when its just too slowNantes when its just too slow
Nantes when its just too slow
 
HTML5 APIs - Where No Man Has Gone Before - StarTechConf, Chile
HTML5 APIs - Where No Man Has Gone Before - StarTechConf, ChileHTML5 APIs - Where No Man Has Gone Before - StarTechConf, Chile
HTML5 APIs - Where No Man Has Gone Before - StarTechConf, Chile
 
Hyper-V Dynamic Memory in Depth
Hyper-V Dynamic Memory in Depth Hyper-V Dynamic Memory in Depth
Hyper-V Dynamic Memory in Depth
 
Performance Implications of Mobile Design
Performance Implications of Mobile DesignPerformance Implications of Mobile Design
Performance Implications of Mobile Design
 
Bca1931 final
Bca1931 finalBca1931 final
Bca1931 final
 
Scaling Drupal: Not IF... HOW
Scaling Drupal: Not IF... HOWScaling Drupal: Not IF... HOW
Scaling Drupal: Not IF... HOW
 
High Performance Websites
High Performance WebsitesHigh Performance Websites
High Performance Websites
 
Velocity 2012: The 90-Minute Mobile Optimization Life Cycle
Velocity 2012: The 90-Minute Mobile Optimization Life CycleVelocity 2012: The 90-Minute Mobile Optimization Life Cycle
Velocity 2012: The 90-Minute Mobile Optimization Life Cycle
 
[Challenge:Future] Chocoholic
[Challenge:Future] Chocoholic [Challenge:Future] Chocoholic
[Challenge:Future] Chocoholic
 
Adaptive Web Design Workshop [inspire 2011]
Adaptive Web Design Workshop [inspire 2011]Adaptive Web Design Workshop [inspire 2011]
Adaptive Web Design Workshop [inspire 2011]
 
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web [Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
 
Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]Adaptive Web Design Workshop [Iceweb 2011]
Adaptive Web Design Workshop [Iceweb 2011]
 
IBM Connect 2016 - AD1548 - Building Responsive XPages Applications
IBM Connect 2016 - AD1548 - Building Responsive XPages ApplicationsIBM Connect 2016 - AD1548 - Building Responsive XPages Applications
IBM Connect 2016 - AD1548 - Building Responsive XPages Applications
 
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
 
Aptimize SharePoint Datasheet
Aptimize SharePoint DatasheetAptimize SharePoint Datasheet
Aptimize SharePoint Datasheet
 
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
 

En vedette

3.1 natura si echilibrul sau
3.1 natura si echilibrul sau3.1 natura si echilibrul sau
3.1 natura si echilibrul saueszinfotanar
 
龍骨王 研究到創業
龍骨王 研究到創業龍骨王 研究到創業
龍骨王 研究到創業Long Good
 
3.3 inventii ce au_revolutionat_lumea2
3.3 inventii ce au_revolutionat_lumea23.3 inventii ce au_revolutionat_lumea2
3.3 inventii ce au_revolutionat_lumea2eszinfotanar
 
Blogun Раскрутка и Заработок
Blogun Раскрутка и ЗаработокBlogun Раскрутка и Заработок
Blogun Раскрутка и ЗаработокOlga Froll
 
龍骨王中小企業演講 如何做好六分鐘創投演講1029
龍骨王中小企業演講 如何做好六分鐘創投演講1029龍骨王中小企業演講 如何做好六分鐘創投演講1029
龍骨王中小企業演講 如何做好六分鐘創投演講1029Long Good
 
龍骨王中小企業演講 如何做好六分鐘創投演講
龍骨王中小企業演講 如何做好六分鐘創投演講龍骨王中小企業演講 如何做好六分鐘創投演講
龍骨王中小企業演講 如何做好六分鐘創投演講Long Good
 
Research process
Research processResearch process
Research processchter
 
Blood group association
Blood group associationBlood group association
Blood group associationRaghu Veer
 

En vedette (8)

3.1 natura si echilibrul sau
3.1 natura si echilibrul sau3.1 natura si echilibrul sau
3.1 natura si echilibrul sau
 
龍骨王 研究到創業
龍骨王 研究到創業龍骨王 研究到創業
龍骨王 研究到創業
 
3.3 inventii ce au_revolutionat_lumea2
3.3 inventii ce au_revolutionat_lumea23.3 inventii ce au_revolutionat_lumea2
3.3 inventii ce au_revolutionat_lumea2
 
Blogun Раскрутка и Заработок
Blogun Раскрутка и ЗаработокBlogun Раскрутка и Заработок
Blogun Раскрутка и Заработок
 
龍骨王中小企業演講 如何做好六分鐘創投演講1029
龍骨王中小企業演講 如何做好六分鐘創投演講1029龍骨王中小企業演講 如何做好六分鐘創投演講1029
龍骨王中小企業演講 如何做好六分鐘創投演講1029
 
龍骨王中小企業演講 如何做好六分鐘創投演講
龍骨王中小企業演講 如何做好六分鐘創投演講龍骨王中小企業演講 如何做好六分鐘創投演講
龍骨王中小企業演講 如何做好六分鐘創投演講
 
Research process
Research processResearch process
Research process
 
Blood group association
Blood group associationBlood group association
Blood group association
 

Similaire à Optimize Web Performance Meetup

Web Performance 101
Web Performance 101Web Performance 101
Web Performance 101Uri Lavi
 
A Lap Around Internet Explorer 8
A Lap Around Internet Explorer 8A Lap Around Internet Explorer 8
A Lap Around Internet Explorer 8rsnarayanan
 
Web前端性能分析工具导引
Web前端性能分析工具导引Web前端性能分析工具导引
Web前端性能分析工具导引冰 郭
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuningJohn McCaffrey
 
A Day Building Fast, Responsive, Extensible Single Page Applications
A Day Building Fast, Responsive, Extensible Single Page ApplicationsA Day Building Fast, Responsive, Extensible Single Page Applications
A Day Building Fast, Responsive, Extensible Single Page ApplicationsChris Love
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...Amazon Web Services
 
Speed is Essential for a Great Web Experience
Speed is Essential for a Great Web ExperienceSpeed is Essential for a Great Web Experience
Speed is Essential for a Great Web ExperienceAndy Davies
 
Shopzilla - Performance By Design
Shopzilla - Performance By DesignShopzilla - Performance By Design
Shopzilla - Performance By DesignTim Morrow
 
ASPNET Roadmap
ASPNET RoadmapASPNET Roadmap
ASPNET Roadmapukdpe
 
Speed is Essential for a Great Web Experience (Canvas Conf Version)
Speed is Essential for a Great Web Experience (Canvas Conf Version)Speed is Essential for a Great Web Experience (Canvas Conf Version)
Speed is Essential for a Great Web Experience (Canvas Conf Version)Andy Davies
 
The Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesThe Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesWesley Hales
 
Performance Measurement and Monitoring for Salesforce Web & Mobile Apps
Performance Measurement and Monitoring for Salesforce Web & Mobile AppsPerformance Measurement and Monitoring for Salesforce Web & Mobile Apps
Performance Measurement and Monitoring for Salesforce Web & Mobile AppsSalesforce Developers
 
Template tuning for high performance
Template tuning for high performanceTemplate tuning for high performance
Template tuning for high performanceChris Davenport
 
CTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should KnowCTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should KnowSpiffy
 

Similaire à Optimize Web Performance Meetup (20)

Web Performance 101
Web Performance 101Web Performance 101
Web Performance 101
 
A Lap Around Internet Explorer 8
A Lap Around Internet Explorer 8A Lap Around Internet Explorer 8
A Lap Around Internet Explorer 8
 
Web前端性能分析工具导引
Web前端性能分析工具导引Web前端性能分析工具导引
Web前端性能分析工具导引
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
A Day Building Fast, Responsive, Extensible Single Page Applications
A Day Building Fast, Responsive, Extensible Single Page ApplicationsA Day Building Fast, Responsive, Extensible Single Page Applications
A Day Building Fast, Responsive, Extensible Single Page Applications
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
Speed is Essential for a Great Web Experience
Speed is Essential for a Great Web ExperienceSpeed is Essential for a Great Web Experience
Speed is Essential for a Great Web Experience
 
Shopzilla - Performance By Design
Shopzilla - Performance By DesignShopzilla - Performance By Design
Shopzilla - Performance By Design
 
ASPNET Roadmap
ASPNET RoadmapASPNET Roadmap
ASPNET Roadmap
 
Making the web faster
Making the web fasterMaking the web faster
Making the web faster
 
Speed is Essential for a Great Web Experience (Canvas Conf Version)
Speed is Essential for a Great Web Experience (Canvas Conf Version)Speed is Essential for a Great Web Experience (Canvas Conf Version)
Speed is Essential for a Great Web Experience (Canvas Conf Version)
 
The Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesThe Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devices
 
SEO for Developers
SEO for DevelopersSEO for Developers
SEO for Developers
 
Modern Web Applications
Modern Web ApplicationsModern Web Applications
Modern Web Applications
 
Performance Measurement and Monitoring for Salesforce Web & Mobile Apps
Performance Measurement and Monitoring for Salesforce Web & Mobile AppsPerformance Measurement and Monitoring for Salesforce Web & Mobile Apps
Performance Measurement and Monitoring for Salesforce Web & Mobile Apps
 
Template tuning for high performance
Template tuning for high performanceTemplate tuning for high performance
Template tuning for high performance
 
Coding the UI
Coding the UICoding the UI
Coding the UI
 
Coding Ui
Coding UiCoding Ui
Coding Ui
 
CTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should KnowCTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should Know
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
 

Dernier

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Dernier (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

Optimize Web Performance Meetup

  • 1.
  • 2. ‫נעים להכיר ...‬ ‫‪ ‬חברה המתמחה במתן שירותים בתחום ניהול ביצועי מערכות‬ ‫בכלל ומערכות מבוססות דפדפן בפרט‬ ‫‪ ‬מנהלי ‪Israel Web Performance Optimization meetup‬‬ ‫‪ ‬נציגי, מטמיעי ומפתחי פתרונות תוכנה בתחומים:‬ ‫‪ ‬האצת אתרים‬ ‫‪ ‬ניטור ואיתור תקלות בזמן אמת‬ ‫‪www.efficens-software.com ‬‬ ‫‪Twitter: efficens ‬‬ ‫‪ :Facebook ‬אפיסנס סופטוור בע"מ‬ ‫‪http://www.meetup.com/wpo-il ‬‬
  • 3. ‫בתוכנית היום‬  What is Web Performance  How does Web Performance affects our bottom line  The web Performance building blocks  Knowing your audience: understanding Browser behaviors  Measuring Performance using YSlow and Google PageSpeed  Understanding Waterfalls  Working with WebPageTest  Working with DynaTrace Ajax Edition  JavaScript and you
  • 4.
  • 5. ‫"הזמן הנתפס על ידי המבקר באתר‬ ‫בין פעולה (כמו לחיצה) עד לתגובה‬ ‫משמעותית"‬ ‫‪Stephan Thair, Seriti consulting‬‬
  • 7.
  • 8. ‫איטיות והמוח שלנו‬ “Brain wave analysis from the experiment revealed that participants had to concentrate up to 50% more when using badly performing websites, while facial muscle and behavioural analysis of the subjects also revealed greater agitation and stress in these periods. http://www.ca.com/Files/SupportingPieces/final_webstr ess_survey_report_229296.pdf
  • 9. 10 Performanc e 5 improvemen 6 secs 8 secs 2 secs 4 secs t (seconds) 0 -5 -8% -10 -25% -15 -33% Percentage change in -20 -38% page abandonme -25 nt -30 -35 -40 urce: Gomez 2010 Study of 500 Million End-User Interactions Across 200+ Web Sites
  • 13.
  • 14. ‫מהם ביצועים טובים ?‬ ‫1.0 שניות נותן תחושה של תגובה מיידית‬ ‫‪‬‬ ‫1 שניה מונע הסחת דעת ומאפשרת רצף מחשבתי‬ ‫‪‬‬ ‫01 שניות שומרות על תשומת לב הגולש‬ ‫‪‬‬ ‫8 שניות הוא הזמן הממוצע שלוקח לגולש לקבל החלטה האם‬ ‫‪‬‬ ‫הוא נשאר בדף או עובר למקום אחר‬ ‫‪Jakob Neilsen. http://www.useit.com/alertbox/response-times.html‬‬
  • 15.
  • 16.
  • 17.
  • 18. Web performance anatomy Latency HTTP AJAX/XHR IE Firefox Chrome Browser Internet Server Safari Opera Images CSS JavaScript Cache Flash Parsing DNS 3rd-party Layouting Server servers Rendering
  • 19. ‫מרכיבי זמן התגובה‬ ‫קריטי ליישומי‬ ‫0.2 ‪Web‬‬ ‫‪Server side‬‬ ‫‪Content delivery‬‬ ‫‪Rendering‬‬ ‫מחוץ למסגרת המערכת אבל‬ ‫עדיין באחריותנו‬ ‫%09-08 מהזמן נצרך מחוץ לגבולות השרת‬ ‫91‬
  • 20.
  • 22. ‫הורדת ‪ 200KB‬בקווי‬ ‫‪1.5Mb/Sec‬‬ ‫אורכת כשנייה‬
  • 23. ‫לא הבטיחו לנו ממשק אחיד, פשוט ורזה ?‬
  • 24. It’s a Multi-Browser World: Different for Each Customer Base Source: http://arstechnica.com/web/news/2011/02/chrome-takes-10-usage-share-ie-continues-to-haemorrhage.ars; http://gs.statcounter.com/#browser_version-ww-monthly-201001-201101
  • 25. Load Time Perceived Render 25 20 15 Seconds 10 5 0 Source: Gomez Real-User Monitoring Real users around the world 466 million page measurements Broadband connections only 200+ sites
  • 26.
  • 27. Fragmented, • Who is #1 today? Tomorrow? rapidly-changing 7 market • Who is #1 with your customers? 6 8 Different • Number of parallel connections operational • JavaScript processing characteristics • Etc.  Browser Processing • Percentage of total moving to the  Network browser response time  Infrastructure • Performance Major impact on • Functionality user experience • Appearance
  • 28.
  • 29. ? ‫מה מודדים‬ ‫• בדיקות מבוססות זמן‬ Time to first byte • Time to first impression • onLoad • Fully loaded time • ‫• "ציוני תקן" המבוססים על מתודולוגיות ידועות‬ Yahoo! YSlow • Google Page Speed • dynaTrace AJAX edition •
  • 30.  Minimize HTTP Requests  Remove Duplicate Scripts  Use a Content Delivery Network  Configure ETags  Add an Expires or a Cache-  Make AJAX Cacheable Control Header  Use GET for AJAX Requests  Gzip Components  Reduce the Number of DOM  Put StyleSheets at the Top Elements  Put Scripts at the Bottom  No 404s  Avoid CSS Expressions  Reduce Cookie Size  Make JavaScript and CSS  Use Cookie-Free Domains for External Components  Reduce DNS Lookups  Avoid Filters  Minify JavaScript and CSS  Do Not Scale Images in HTML  Avoid Redirects  Make favicon.ico Small & Cacheable http://developer.yahoo.com/yslow/help/#guidelines
  • 31.  Avoid bad requests  Minimize redirects  Avoid CSS expressions  Optimize images  Combine external CSS  Optimize the order of styles and scripts  Combine external JavaScript  Parallelize downloads across  Defer loading of JavaScript hostnames  Enable compression  Put CSS in the document head  Leverage browser caching  Remove unused CSS  Leverage proxy caching  Serve resources from a consistent  Minify CSS URL  Minify HTML  Serve scaled images  Minify JavaScript  Serve static content from a cookieless domain  Minimize request size  Specify a character set early  Minimize DNS lookups  Specify image dimensions http://code.google.com/speed/page-speed/docs/rules_intro.html  Use efficient CSS selectors
  • 34.
  • 35. ‫מהירות טעינה‬ ‫מספר בקשות‬ YSLOW ‫ציון‬ PS ‫ציון‬ ‫שם האתר‬ 2.258 4 94 77 Roninsight 8.042 8 92 88 Roninsight (WP) 4.05 90 74 76 ionroad 22.856 149 70 64 ELAL 13.29 53 73 83 rompr
  • 36.
  • 37. ? ‫רוצים עוד‬ Http KeepAlive • Async JS Load • DOM Elements • CDN •
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 50.
  • 51.
  • 52. Webmaster Tools Google Analytics What is measured Time from Initial Page Request to “Document Complete” How it’s measured Google Toolbar Navigation Timing + Google Toolbar on IE Browsers measured Firefox 2-4 IE 9+ IE 6-9 Chrome 6+ with Google Toolbar & Firefox 7+ PageRank Enabled Android 4+ IE 6-8 with Google Toolbar Sampling rate All Clients (assumed) 1% of clients, max 10K/day Averaging techniques 7-day running weighted 30-day simple average average (popular pages (average the individual matter more) page’s average load times(
  • 54.
  • 55.
  • 56.
  • 59. What’s the #1 cause of slow web pages?
  • 61. JavaScript performance directly affects user experience
  • 62. The browser UI thread is responsible for both UI updates and JavaScript execution Only one can happen at a time
  • 63. <button id="btn" style="font-size: 30px; padding: 0.5em 1em">Click Me</button> <script type="text/javascript"> window.onload = function(){ document.getElementById("btn").onclick = function(){ //do something }; }; </script>
  • 65. When Clicked UI Thread time UI Queue UI Update onclick UI Update
  • 66. When Clicked UI Thread UI Update time UI Queue onclick Draw down state UI Update
  • 67. When Clicked UI Thread UI Update onclick time UI Queue UI Update
  • 68. When Clicked UI Thread UI Update onclick UI Update time UI Queue Draw up state
  • 69. No UI updates while JavaScript is executing
  • 70. Loadtime Techniques Don't let JavaScript interfere with page load performance
  • 71. <!doctype html> <html> <head> <title>Example</title> </head> <body> <p>Hello world!</p> <script src="foo.js"></script> <p>See ya!</p> </body> </html>
  • 72. Result UI Thread Hello world! Download Parse Run See ya! time The UI thread needs to wait for the script to download, parse, and run before continuing
  • 73. Translation: The page doesn't render while JavaScript is downloading, parsing, or executing during page load
  • 74. Result UI Thread JavaScript UI Update JavaScript UI Update JavaScript time The more scripts to download in between UI updates, the longer the page takes to render
  • 75. Technique #1: Load scripts dynamically
  • 76. Basic Technique var script = document.createElement("script"), body; script.type = "text/javascript"; script.src = "foo.js"; body.insertBefore(script, body.firstChild); Dynamically loaded scripts are non-blocking
  • 77. Downloads no longer block the UI thread
  • 78. Using Dynamic Scripts UI Thread Hello world! See ya! Run UI Update time Download Parse Only code execution happens on the UI thread, which means less blocking of UI updates
  • 79. function loadScript(url, callback){ var script = document.createElement("script"), body = document.body; script.type = "text/javascript"; if (script.readyState){ //IE <= 8 script.onreadystatechange = function(){ if (script.readyState == "loaded" || script.readyState == "complete"){ script.onreadystatechange = null; callback(); } }; } else { //Others script.onload = function(){ callback(); }; } script.src = url; body.insertBefore(script, body.firstChild); }
  • 80. Usage loadScript("foo.js", function(){ alert("Loaded!"); });
  • 81. Timing Note: Script execution begins immediately after download and parse – timing of execution is not guaranteed
  • 83. <!doctype html> <html> <head> <title>Example</title> </head> <body> <p>Hello world!</p> <script defer src="foo.js"></script> <p>See ya!</p> <!-- even more markup --> </body> </html>
  • 84. Support for <script defer> 3.5 7.0 5.0 4.0 ?
  • 85. Deferred scripts begin to download immediately, but don't execute until all UI updates complete
  • 86. Using <script defer> UI Thread Hello world! See ya! More UI More UI Run time Download Parse Similar to dynamic script nodes, but with a guarantee that execution will happen last
  • 87. Timing Note: Although scripts always execute after UI updates complete, the order of multiple <script defer> scripts is not guaranteed across browsers
  • 89. <!doctype html> <html> <head> <title>Example</title> </head> <body> <p>Hello world!</p> <script async src="foo.js"></script> <p>See ya!</p> <!-- even more markup --> </body> </html>
  • 90. Support for <script async> 3.6 7.0 5.0 10 ?
  • 91. Using <script async> UI Thread Hello world! See ya! Run UI Update time Download Parse Download begins immediately and execution is slotted in at first available spot
  • 92. Note: Order of execution is explicitly not preserved for asynchronous scripts
  • 94. //create a new timer and delay by 500ms setTimeout(function(){ //code to execute here }, 500); setTimeout() schedules a function to be added to the UI queue after a delay
  • 96.
  • 97. Support for Web Workers 3.5 4.0 4.0 10 10.6
  • 98. Web Workers  Asynchronous JavaScript execution  Execution happens outside the UI thread  Doesn’t block UI updates  Data-Driven API  Data is serialized going into and out of the worker  No access to DOM or BOM  Separate execution environment
  • 99. ‫כלים - סיכום‬  Google Page Speed Tools Family http://code.google.com/speed/page-speed/  dynaTrace AJAX Edition http://ajax.dynatrace.com/ajax/en/  Yahoo! YSlow http://developer.yahoo.com/yslow/  WebPagetest http://www.webpagetest.org/  Show Slow http://www.showslow.com/  Let's Make the Web Faster http://code.google.com/intl/en-EN/speed/tools.html
  • 100.  Books - High Performance Web Sites - Even Faster Web Sites - Website Optimization - Complete Web Monitoring -High Performance JavaScript
  • 101.
  • 102. gil@efficens-software.com 054-2552060 @efficens