SlideShare a Scribd company logo
1 of 44
Cyra Richardson
Senior Program Manager Lead
Microsoft Corporation
Making apps better today in IE
No magic solutions
Requires page script modification
MS Research Preview: AJAX View
Fiddler
More on tools at the end of the talk
Lexical scope used to create scope chain
Scope chain used as map to resolve symbolic reference
Local vars resolved from most specific to least
Worst case is expando variable creation
DOM is at the end of the scope chain
function WorkOnLocalVariable()
  {
     local_variable = ObtainValueFromDOM();
     return (local_variable + 1);
  }
function WorkOnLocalVariable()
  {
     var local_variable = ObtainValueFromDOM();
     return (local_variable + 1);
  }
function BuildUI()
  {
       var baseElement = document.getElementById(‘target’);
       baseElement.innerHTML = ‘’; // Clear out the previous
       baseElement.innerHTML += BuildTitle();
       baseElement.innerHTML += BuildBody();
       baseElement.innerHTML += BuildFooter();
  }
function BuildUI()
  {
       var elementText = BuildTitle() + BuildBody() + BuildFooter();
       document.getElementById(‘target’).innerHTML = elementText;



  }
function CalculateSum()
  {

      var lSide = document.body.all.lSide.value;
      var rSide = document.body.all.rSide.value;
      document.body.all.result.value = lSide + rSide;

  }
function CalculateSum()
  {
       var elemCollection = document.body.all; // Cache this
       var lSide = elemCollection.lSide.value;
       var rSide = elemCollection.rSide.value;
       elemCollection.result.value = lSide + rSide;

  }
function IterateWorkOverCollection()
  {

      var length = myCollection.getItemCount();

      for(var index = 0; index<length; index++)
      {
           Work(myCollection[index]);
      }
  }
function IterateWorkOverCollection()
  {
       var funcWork = Work;
       var length = myCollection.getItemCount();

      for(var index = 0; index<length; index++)
      {
           funcWork(myCollection[index]);
      }
  }
function IterateWorkOverCollection()
   {
  var parentElement = document.getElementById(‘target’);
  var length = myCollection.getItemCount();

      for(var index = 0; index<length; index++)
      {
      parentElement.appendChild(myCollection[iterate]);
      }

  }
function IterateWorkOverCollection()
   {
  var funcAppendChild = document.getElementById(‘target’).appendChild;
  var length = myCollection.getItemCount();

      for(var index = 0; index<length; index++)
      {
      funcAppendChild(myCollection[index]);
      }

  }
var smallerStrings = new Array();
var myRatherLargeString = quot;quot;;
var length = smallerStrings.length;

  for(var index = 0; index<length; index++)
  {
     myRatherLargeString += smallerStrings[index];
  }
var smallerStrings = new Array();
var myRatherLargeString = quot;quot;;
  smallerStrings.push(quot;<div id=quot;quot;);
  smallerStrings.push(quot;sampleIDquot;);
  markupBuilder.push(quot;quot;>quot;);
  smallerStrings.push(quot;sampleTextquot;);
  smallerStrings.push(quot;</div>quot;);
  …
var myRatherLargeString = smallerStrings.join(‘’);
• Perform string operations using local vars
• Cache strings from IE objects
• Use Array.join for concatenation
• Download
• Build string
• Construct new script execution context
• Lookup string
• Parse
• Execution
• Problems
      Script injection increases security risk
  •
      Setup and Parsing takes time
  •
      Error conditions sometimes overlooked
  •


• Solution
      Anticipate and scope code for specific problems
  •
      Use data to drive code
  •
• Javascript - SWITCH becomes costly for large sets
     Problem: Switch processing time grows linearly
 •
     Consider: Hash Table wrapped in Try, Catch
 •
     Why: Javascript does not optimize Switch
 •


• Javascript - WITH
     Problems: Increases symbol look up time everywhere
 •
     Consider: Use manual iterators
 •
     Why: Adds entry to the scope chain
 •
• Property Accessor Functions (get/set)
      Problems: Increases cycles to access values
  •
      Consider: Directly modifying variables
  •
      Why: Inserts an additional symbol lookup
  •
Instantiating DOM functions
    Problems: Costly (in CPU cycles)
•
    Consider: Be Informed/Intentional
•
    Why: Platform Genericness
•


Accessing / Traversing DOM properties
    Problems: Each access is costly
•
    Consider: Caching values/function pointers
•
    Why: Platform Genericness
•
Download from Server
 Javascript
 CSS
 Images
 HTML
Layout
Execute Script
Script in one JS file
Styles in one CSS file
Fewer, Smaller, unscaled images
Simplify layout
Use HTTP Compression
Request                                          Response                                 2
                                             1


GET / HTTP/1.1                                   HTTP/1.1 200 OK
Accept: */*                                      Content-Length: 3479
Accept-Language: en-us                           Expires: -1
UA-CPU: x86                                      Date: Tue, 24 Apr 2007 21:30:46 GMT
Accept-Encoding: gzip, deflate                   Content-Type: text/html; charset=utf-8
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0)   Pragma: no-cache
Host: www.live.com                               Content-Encoding: gzip
Load from cache or download from Server
 Javascript
 CSS
 Images
 HTML
Layout
Execute Script
Conditional HTTP Requests
 Plain HTTP Request
  Pragma: no-cache

 Time Conditional
  If-modified-since: datetime


 ETAG Conditional
  If-none-match: etagvalue
1                                                  2
Request                                            Response
GET /images/banner.jpg HTTP/1.1                    HTTP/1.1 200 OK
Host: www.bayden.com                               Date: Wed, 25 Apr 2007 18:30:10 GMT
                                                   Content-Type: image/jpeg
                                                   ETag: quot;40c7f76e8d30c31:3d5quot;
                                                   Last-Modified: Thu, 12 Jun 2003 02:50:50 GMT
                                                                                                  4
                                               3
Request                                            Response
GET /images/banner.jpg HTTP/1.1                    HTTP/1.1 304 Not Modified
If-Modified-Since: Thu, 12 Jun 2003 02:50:50 GMT   Date: Wed, 25 Apr 2007 18:30:10 GMT
If-None-Match: quot;40c7f76e8d30c31:3d5quot;
Host: www.bayden.com
1                                                  2
Request                               Response
GET /images/banner.jpg HTTP/1.1       HTTP/1.1 200 OK
Host: www.bayden.com                  Date: Thu, 26 Apr 2007 00:20:42 GMT
                                      Content-Type: image/jpeg
                                      Last-Modified: Thu, 12 Jun 2003 02:50:50 GMT
                                      Expires: Fri, 12 Jun 2009 02:50:50 GMT
                                                                                     4
                                  3
Request                               Response
GET /images/banner.jpg HTTP/1.1
                                                     No Response:
                                                     Request Serviced from
                                                     cache
Common Cache-Control Headers
 public
 private
 no-cache
 no-store
 max-age=#seconds
 must-revalidate
Developer Toolbar
Fiddler
AJAX View
Cyra Richardson
Senior Lead Program Manager
Microsoft Corporation - Internet Explorer Team
Emre Kiciman
Researcher
Microsoft Research
Goal: Improve dev visibility into web app behavior
      Cross-browser, no client-side software changes
      Fine-grained, code-level monitoring
      Flexible instrumentation: performance, state, etc.

Approach: “On-the-fly” JS rewriting adds instrumentation only when/where it is needed

Status: Tech preview release coming soon
      Demo’ing now at Hands-on-Lab
      http://research.microsoft.com/projects/ajaxview/


Future Directions:
      Integration into IE developer toolbar
      Integration into server-side tools to let dev see real-user experience
Identify the type of performance problem
 Network / Bandwidth – using Fiddler
 Javascript – Using AJAX View
 Aggressive DOM access – Using AJAX View
Reduce, Simplify, Re-factor
 Reduce the bytes sent between the client/server
 Simplify your code to avoid costly Javascript constructs
 Cache DOM properties and function pointers
Fiddler - www.fiddler2.com
AJAX View – http://research.microsoft.com/projects/ajaxview/
IE Blog - http://blogs.msdn.com/ie
Cyra Richardson – Cyrar@microsoft.com
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions,
                it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
                                       MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related Content

What's hot

Operacion Guinda 2
Operacion Guinda 2Operacion Guinda 2
Operacion Guinda 2Red RADAR
 
Introduction to rest.li
Introduction to rest.liIntroduction to rest.li
Introduction to rest.liJoe Betz
 
Capture, record, clip, embed and play, search: video from newbie to ninja
Capture, record, clip, embed and play, search: video from newbie to ninjaCapture, record, clip, embed and play, search: video from newbie to ninja
Capture, record, clip, embed and play, search: video from newbie to ninjaVito Flavio Lorusso
 
Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsMatthew Beale
 
Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuAppUniverz Org
 
Even faster django
Even faster djangoEven faster django
Even faster djangoGage Tseng
 
Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009
Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009
Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009Hiroshi Ono
 
JS Lab`16. Владимир Воевидка: "Как работает браузер"
JS Lab`16. Владимир Воевидка: "Как работает браузер"JS Lab`16. Владимир Воевидка: "Как работает браузер"
JS Lab`16. Владимир Воевидка: "Как работает браузер"GeeksLab Odessa
 
gDayX - Advanced angularjs
gDayX - Advanced angularjsgDayX - Advanced angularjs
gDayX - Advanced angularjsgdgvietnam
 
GWT integration with Vaadin
GWT integration with VaadinGWT integration with Vaadin
GWT integration with VaadinPeter Lehto
 
Connect2016 AD1387 Integrate with XPages and Java
Connect2016 AD1387 Integrate with XPages and JavaConnect2016 AD1387 Integrate with XPages and Java
Connect2016 AD1387 Integrate with XPages and JavaJulian Robichaux
 
EWD 3 Training Course Part 14: Using Ajax for QEWD Messages
EWD 3 Training Course Part 14: Using Ajax for QEWD MessagesEWD 3 Training Course Part 14: Using Ajax for QEWD Messages
EWD 3 Training Course Part 14: Using Ajax for QEWD MessagesRob Tweed
 
Security and performance designs for client-server communications
Security and performance designs for client-server communicationsSecurity and performance designs for client-server communications
Security and performance designs for client-server communicationsWO Community
 
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 2
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 2EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 2
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 2Rob Tweed
 
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletongDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletonGeorge Nguyen
 
The three aaS's of MongoDB in Windows Azure
The three aaS's of MongoDB in Windows AzureThe three aaS's of MongoDB in Windows Azure
The three aaS's of MongoDB in Windows AzureMongoDB
 

What's hot (19)

Operacion Guinda 2
Operacion Guinda 2Operacion Guinda 2
Operacion Guinda 2
 
Introduction to rest.li
Introduction to rest.liIntroduction to rest.li
Introduction to rest.li
 
Capture, record, clip, embed and play, search: video from newbie to ninja
Capture, record, clip, embed and play, search: video from newbie to ninjaCapture, record, clip, embed and play, search: video from newbie to ninja
Capture, record, clip, embed and play, search: video from newbie to ninja
 
Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web Standards
 
Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. Wu
 
Even faster django
Even faster djangoEven faster django
Even faster django
 
YouDrup_in_Drupal
YouDrup_in_DrupalYouDrup_in_Drupal
YouDrup_in_Drupal
 
Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009
Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009
Solving_the_C20K_problem_PHP_Performance_and_Scalability-phpquebec_2009
 
JS Lab`16. Владимир Воевидка: "Как работает браузер"
JS Lab`16. Владимир Воевидка: "Как работает браузер"JS Lab`16. Владимир Воевидка: "Как работает браузер"
JS Lab`16. Владимир Воевидка: "Как работает браузер"
 
ICEfaces and JSF 2.0 on GlassFish
ICEfaces and JSF 2.0 on GlassFishICEfaces and JSF 2.0 on GlassFish
ICEfaces and JSF 2.0 on GlassFish
 
gDayX - Advanced angularjs
gDayX - Advanced angularjsgDayX - Advanced angularjs
gDayX - Advanced angularjs
 
GWT integration with Vaadin
GWT integration with VaadinGWT integration with Vaadin
GWT integration with Vaadin
 
Connect2016 AD1387 Integrate with XPages and Java
Connect2016 AD1387 Integrate with XPages and JavaConnect2016 AD1387 Integrate with XPages and Java
Connect2016 AD1387 Integrate with XPages and Java
 
EWD 3 Training Course Part 14: Using Ajax for QEWD Messages
EWD 3 Training Course Part 14: Using Ajax for QEWD MessagesEWD 3 Training Course Part 14: Using Ajax for QEWD Messages
EWD 3 Training Course Part 14: Using Ajax for QEWD Messages
 
Security and performance designs for client-server communications
Security and performance designs for client-server communicationsSecurity and performance designs for client-server communications
Security and performance designs for client-server communications
 
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 2
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 2EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 2
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 2
 
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletongDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
 
The three aaS's of MongoDB in Windows Azure
The three aaS's of MongoDB in Windows AzureThe three aaS's of MongoDB in Windows Azure
The three aaS's of MongoDB in Windows Azure
 
MWLUG 2017 - Elementary!
MWLUG 2017 - Elementary!MWLUG 2017 - Elementary!
MWLUG 2017 - Elementary!
 

Viewers also liked

Using the RSS Platform on Windows: Syndication Goes Mainstream
Using the RSS Platform on Windows: Syndication Goes MainstreamUsing the RSS Platform on Windows: Syndication Goes Mainstream
Using the RSS Platform on Windows: Syndication Goes Mainstreamgoodfriday
 
What Is Easter
What Is EasterWhat Is Easter
What Is Eastergoodfriday
 
Presentation 5 Easter Island Colossi
Presentation 5   Easter Island ColossiPresentation 5   Easter Island Colossi
Presentation 5 Easter Island Colossigoodfriday
 
Powering E-Commerce with PayPal
Powering E-Commerce with PayPalPowering E-Commerce with PayPal
Powering E-Commerce with PayPalgoodfriday
 
Easter Egg Hunt
Easter Egg HuntEaster Egg Hunt
Easter Egg Huntgoodfriday
 
Microsoft Research - Turning Ideas into Reality
Microsoft Research - Turning Ideas into RealityMicrosoft Research - Turning Ideas into Reality
Microsoft Research - Turning Ideas into Realitygoodfriday
 

Viewers also liked (8)

Easterstory
EasterstoryEasterstory
Easterstory
 
Using the RSS Platform on Windows: Syndication Goes Mainstream
Using the RSS Platform on Windows: Syndication Goes MainstreamUsing the RSS Platform on Windows: Syndication Goes Mainstream
Using the RSS Platform on Windows: Syndication Goes Mainstream
 
What Is Easter
What Is EasterWhat Is Easter
What Is Easter
 
Presentation 5 Easter Island Colossi
Presentation 5   Easter Island ColossiPresentation 5   Easter Island Colossi
Presentation 5 Easter Island Colossi
 
Powering E-Commerce with PayPal
Powering E-Commerce with PayPalPowering E-Commerce with PayPal
Powering E-Commerce with PayPal
 
Easter[1]
Easter[1]Easter[1]
Easter[1]
 
Easter Egg Hunt
Easter Egg HuntEaster Egg Hunt
Easter Egg Hunt
 
Microsoft Research - Turning Ideas into Reality
Microsoft Research - Turning Ideas into RealityMicrosoft Research - Turning Ideas into Reality
Microsoft Research - Turning Ideas into Reality
 

Similar to How to Make AJAX Applications Scream on the Client

Optimising Web Application Frontend
Optimising Web Application FrontendOptimising Web Application Frontend
Optimising Web Application Frontendtkramar
 
Building High Performance Web Applications and Sites
Building High Performance Web Applications and SitesBuilding High Performance Web Applications and Sites
Building High Performance Web Applications and Sitesgoodfriday
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup PerformanceGreg Whalin
 
the next web now
the next web nowthe next web now
the next web nowzulin Gu
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterDoris Chen
 
Tuning web performance
Tuning web performanceTuning web performance
Tuning web performanceGeorge Ang
 
Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web PerformanceEric ShangKuan
 
Life on the Edge with ESI
Life on the Edge with ESILife on the Edge with ESI
Life on the Edge with ESIKit Chan
 
Web Performance Part 4 "Client-side performance"
Web Performance Part 4  "Client-side performance"Web Performance Part 4  "Client-side performance"
Web Performance Part 4 "Client-side performance"Binary Studio
 
The Dojo Build System
The Dojo Build SystemThe Dojo Build System
The Dojo Build Systemklipstein
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindSam Keen
 
Whatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the processWhatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the processguest3379bd
 
Generating the Server Response: HTTP Status Codes
Generating the Server Response: HTTP Status CodesGenerating the Server Response: HTTP Status Codes
Generating the Server Response: HTTP Status CodesDeeptiJava
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizationsChris Love
 
Performance Optimization of Rails Applications
Performance Optimization of Rails ApplicationsPerformance Optimization of Rails Applications
Performance Optimization of Rails ApplicationsSerge Smetana
 
JavaScript performance patterns
JavaScript performance patternsJavaScript performance patterns
JavaScript performance patternsStoyan Stefanov
 
BrazilJS Perf Doctor Talk
BrazilJS Perf Doctor TalkBrazilJS Perf Doctor Talk
BrazilJS Perf Doctor TalkJosh Holmes
 

Similar to How to Make AJAX Applications Scream on the Client (20)

Optimising Web Application Frontend
Optimising Web Application FrontendOptimising Web Application Frontend
Optimising Web Application Frontend
 
Building High Performance Web Applications and Sites
Building High Performance Web Applications and SitesBuilding High Performance Web Applications and Sites
Building High Performance Web Applications and Sites
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
 
the next web now
the next web nowthe next web now
the next web now
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
 
Tuning web performance
Tuning web performanceTuning web performance
Tuning web performance
 
Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web Performance
 
Life on the Edge with ESI
Life on the Edge with ESILife on the Edge with ESI
Life on the Edge with ESI
 
Web Performance Part 4 "Client-side performance"
Web Performance Part 4  "Client-side performance"Web Performance Part 4  "Client-side performance"
Web Performance Part 4 "Client-side performance"
 
The Dojo Build System
The Dojo Build SystemThe Dojo Build System
The Dojo Build System
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / Webgrind
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
Whatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the processWhatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the process
 
Generating the Server Response: HTTP Status Codes
Generating the Server Response: HTTP Status CodesGenerating the Server Response: HTTP Status Codes
Generating the Server Response: HTTP Status Codes
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
Performance Optimization of Rails Applications
Performance Optimization of Rails ApplicationsPerformance Optimization of Rails Applications
Performance Optimization of Rails Applications
 
JavaScript performance patterns
JavaScript performance patternsJavaScript performance patterns
JavaScript performance patterns
 
AD102 - Break out of the Box
AD102 - Break out of the BoxAD102 - Break out of the Box
AD102 - Break out of the Box
 
BrazilJS Perf Doctor Talk
BrazilJS Perf Doctor TalkBrazilJS Perf Doctor Talk
BrazilJS Perf Doctor Talk
 

More from goodfriday

Narine Presentations 20051021 134052
Narine Presentations 20051021 134052Narine Presentations 20051021 134052
Narine Presentations 20051021 134052goodfriday
 
09 03 22 easter
09 03 22 easter09 03 22 easter
09 03 22 eastergoodfriday
 
Holy Week Easter 2009
Holy Week Easter 2009Holy Week Easter 2009
Holy Week Easter 2009goodfriday
 
Holt Park Easter 09 Swim
Holt Park Easter 09 SwimHolt Park Easter 09 Swim
Holt Park Easter 09 Swimgoodfriday
 
Swarthmore Lentbrochure20092
Swarthmore Lentbrochure20092Swarthmore Lentbrochure20092
Swarthmore Lentbrochure20092goodfriday
 
Eastercard2009
Eastercard2009Eastercard2009
Eastercard2009goodfriday
 
Easterservices2009
Easterservices2009Easterservices2009
Easterservices2009goodfriday
 
Bulletin Current
Bulletin CurrentBulletin Current
Bulletin Currentgoodfriday
 
March 2009 Newsletter
March 2009 NewsletterMarch 2009 Newsletter
March 2009 Newslettergoodfriday
 
Lent Easter 2009
Lent Easter 2009Lent Easter 2009
Lent Easter 2009goodfriday
 
Easterpowersports09
Easterpowersports09Easterpowersports09
Easterpowersports09goodfriday
 
Easter Trading 09
Easter Trading 09Easter Trading 09
Easter Trading 09goodfriday
 
Easter Brochure 2009
Easter Brochure 2009Easter Brochure 2009
Easter Brochure 2009goodfriday
 
March April 2009 Calendar
March April 2009 CalendarMarch April 2009 Calendar
March April 2009 Calendargoodfriday
 

More from goodfriday (20)

Narine Presentations 20051021 134052
Narine Presentations 20051021 134052Narine Presentations 20051021 134052
Narine Presentations 20051021 134052
 
Triunemar05
Triunemar05Triunemar05
Triunemar05
 
09 03 22 easter
09 03 22 easter09 03 22 easter
09 03 22 easter
 
Holy Week Easter 2009
Holy Week Easter 2009Holy Week Easter 2009
Holy Week Easter 2009
 
Holt Park Easter 09 Swim
Holt Park Easter 09 SwimHolt Park Easter 09 Swim
Holt Park Easter 09 Swim
 
Easter Letter
Easter LetterEaster Letter
Easter Letter
 
April2009
April2009April2009
April2009
 
Swarthmore Lentbrochure20092
Swarthmore Lentbrochure20092Swarthmore Lentbrochure20092
Swarthmore Lentbrochure20092
 
Eastercard2009
Eastercard2009Eastercard2009
Eastercard2009
 
Easterservices2009
Easterservices2009Easterservices2009
Easterservices2009
 
Bulletin Current
Bulletin CurrentBulletin Current
Bulletin Current
 
Easter2009
Easter2009Easter2009
Easter2009
 
Bulletin
BulletinBulletin
Bulletin
 
March 2009 Newsletter
March 2009 NewsletterMarch 2009 Newsletter
March 2009 Newsletter
 
Mar 29 2009
Mar 29 2009Mar 29 2009
Mar 29 2009
 
Lent Easter 2009
Lent Easter 2009Lent Easter 2009
Lent Easter 2009
 
Easterpowersports09
Easterpowersports09Easterpowersports09
Easterpowersports09
 
Easter Trading 09
Easter Trading 09Easter Trading 09
Easter Trading 09
 
Easter Brochure 2009
Easter Brochure 2009Easter Brochure 2009
Easter Brochure 2009
 
March April 2009 Calendar
March April 2009 CalendarMarch April 2009 Calendar
March April 2009 Calendar
 

Recently uploaded

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

How to Make AJAX Applications Scream on the Client

  • 1.
  • 2. Cyra Richardson Senior Program Manager Lead Microsoft Corporation
  • 3. Making apps better today in IE No magic solutions Requires page script modification
  • 4. MS Research Preview: AJAX View Fiddler More on tools at the end of the talk
  • 5.
  • 6. Lexical scope used to create scope chain Scope chain used as map to resolve symbolic reference Local vars resolved from most specific to least Worst case is expando variable creation DOM is at the end of the scope chain
  • 7. function WorkOnLocalVariable() { local_variable = ObtainValueFromDOM(); return (local_variable + 1); }
  • 8. function WorkOnLocalVariable() { var local_variable = ObtainValueFromDOM(); return (local_variable + 1); }
  • 9. function BuildUI() { var baseElement = document.getElementById(‘target’); baseElement.innerHTML = ‘’; // Clear out the previous baseElement.innerHTML += BuildTitle(); baseElement.innerHTML += BuildBody(); baseElement.innerHTML += BuildFooter(); }
  • 10. function BuildUI() { var elementText = BuildTitle() + BuildBody() + BuildFooter(); document.getElementById(‘target’).innerHTML = elementText; }
  • 11. function CalculateSum() { var lSide = document.body.all.lSide.value; var rSide = document.body.all.rSide.value; document.body.all.result.value = lSide + rSide; }
  • 12. function CalculateSum() { var elemCollection = document.body.all; // Cache this var lSide = elemCollection.lSide.value; var rSide = elemCollection.rSide.value; elemCollection.result.value = lSide + rSide; }
  • 13. function IterateWorkOverCollection() { var length = myCollection.getItemCount(); for(var index = 0; index<length; index++) { Work(myCollection[index]); } }
  • 14. function IterateWorkOverCollection() { var funcWork = Work; var length = myCollection.getItemCount(); for(var index = 0; index<length; index++) { funcWork(myCollection[index]); } }
  • 15. function IterateWorkOverCollection() { var parentElement = document.getElementById(‘target’); var length = myCollection.getItemCount(); for(var index = 0; index<length; index++) { parentElement.appendChild(myCollection[iterate]); } }
  • 16. function IterateWorkOverCollection() { var funcAppendChild = document.getElementById(‘target’).appendChild; var length = myCollection.getItemCount(); for(var index = 0; index<length; index++) { funcAppendChild(myCollection[index]); } }
  • 17.
  • 18. var smallerStrings = new Array(); var myRatherLargeString = quot;quot;; var length = smallerStrings.length; for(var index = 0; index<length; index++) { myRatherLargeString += smallerStrings[index]; }
  • 19. var smallerStrings = new Array(); var myRatherLargeString = quot;quot;; smallerStrings.push(quot;<div id=quot;quot;); smallerStrings.push(quot;sampleIDquot;); markupBuilder.push(quot;quot;>quot;); smallerStrings.push(quot;sampleTextquot;); smallerStrings.push(quot;</div>quot;); … var myRatherLargeString = smallerStrings.join(‘’);
  • 20. • Perform string operations using local vars • Cache strings from IE objects • Use Array.join for concatenation
  • 21. • Download • Build string • Construct new script execution context • Lookup string • Parse • Execution
  • 22. • Problems Script injection increases security risk • Setup and Parsing takes time • Error conditions sometimes overlooked • • Solution Anticipate and scope code for specific problems • Use data to drive code •
  • 23. • Javascript - SWITCH becomes costly for large sets Problem: Switch processing time grows linearly • Consider: Hash Table wrapped in Try, Catch • Why: Javascript does not optimize Switch • • Javascript - WITH Problems: Increases symbol look up time everywhere • Consider: Use manual iterators • Why: Adds entry to the scope chain •
  • 24. • Property Accessor Functions (get/set) Problems: Increases cycles to access values • Consider: Directly modifying variables • Why: Inserts an additional symbol lookup •
  • 25.
  • 26. Instantiating DOM functions Problems: Costly (in CPU cycles) • Consider: Be Informed/Intentional • Why: Platform Genericness • Accessing / Traversing DOM properties Problems: Each access is costly • Consider: Caching values/function pointers • Why: Platform Genericness •
  • 27.
  • 28. Download from Server Javascript CSS Images HTML Layout Execute Script
  • 29. Script in one JS file Styles in one CSS file Fewer, Smaller, unscaled images Simplify layout Use HTTP Compression
  • 30. Request Response 2 1 GET / HTTP/1.1 HTTP/1.1 200 OK Accept: */* Content-Length: 3479 Accept-Language: en-us Expires: -1 UA-CPU: x86 Date: Tue, 24 Apr 2007 21:30:46 GMT Accept-Encoding: gzip, deflate Content-Type: text/html; charset=utf-8 User-Agent: Mozilla/4.0 (compatible; MSIE 7.0) Pragma: no-cache Host: www.live.com Content-Encoding: gzip
  • 31. Load from cache or download from Server Javascript CSS Images HTML Layout Execute Script
  • 32. Conditional HTTP Requests Plain HTTP Request Pragma: no-cache Time Conditional If-modified-since: datetime ETAG Conditional If-none-match: etagvalue
  • 33. 1 2 Request Response GET /images/banner.jpg HTTP/1.1 HTTP/1.1 200 OK Host: www.bayden.com Date: Wed, 25 Apr 2007 18:30:10 GMT Content-Type: image/jpeg ETag: quot;40c7f76e8d30c31:3d5quot; Last-Modified: Thu, 12 Jun 2003 02:50:50 GMT 4 3 Request Response GET /images/banner.jpg HTTP/1.1 HTTP/1.1 304 Not Modified If-Modified-Since: Thu, 12 Jun 2003 02:50:50 GMT Date: Wed, 25 Apr 2007 18:30:10 GMT If-None-Match: quot;40c7f76e8d30c31:3d5quot; Host: www.bayden.com
  • 34. 1 2 Request Response GET /images/banner.jpg HTTP/1.1 HTTP/1.1 200 OK Host: www.bayden.com Date: Thu, 26 Apr 2007 00:20:42 GMT Content-Type: image/jpeg Last-Modified: Thu, 12 Jun 2003 02:50:50 GMT Expires: Fri, 12 Jun 2009 02:50:50 GMT 4 3 Request Response GET /images/banner.jpg HTTP/1.1 No Response: Request Serviced from cache
  • 35. Common Cache-Control Headers public private no-cache no-store max-age=#seconds must-revalidate
  • 37. Cyra Richardson Senior Lead Program Manager Microsoft Corporation - Internet Explorer Team
  • 39. Goal: Improve dev visibility into web app behavior Cross-browser, no client-side software changes Fine-grained, code-level monitoring Flexible instrumentation: performance, state, etc. Approach: “On-the-fly” JS rewriting adds instrumentation only when/where it is needed Status: Tech preview release coming soon Demo’ing now at Hands-on-Lab http://research.microsoft.com/projects/ajaxview/ Future Directions: Integration into IE developer toolbar Integration into server-side tools to let dev see real-user experience
  • 40.
  • 41. Identify the type of performance problem Network / Bandwidth – using Fiddler Javascript – Using AJAX View Aggressive DOM access – Using AJAX View Reduce, Simplify, Re-factor Reduce the bytes sent between the client/server Simplify your code to avoid costly Javascript constructs Cache DOM properties and function pointers
  • 42. Fiddler - www.fiddler2.com AJAX View – http://research.microsoft.com/projects/ajaxview/ IE Blog - http://blogs.msdn.com/ie Cyra Richardson – Cyrar@microsoft.com
  • 43.
  • 44. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.