SlideShare uma empresa Scribd logo
1 de 29
Performance Best Practices - Part 1 -
Client Side [JS, CSS, HTML, jQuery]
Presenter: Sathyan, Mindfire Solutions
Date: 03rd Sep 2013
Image Source: http://www.webperformancetoday.com/2011/06/30/revisiting-the-
performance-equation/ Presenter: Sathyan, Mindfire Solutions
Presenter: Sathyan, Mindfire Solutions
 Average Frontend time is 75% and above
 No inline JavaScript
 No Inline Styles
 Refer only the necessary include [js, css, etc.]
files for the page
 Always remove code, DOM, CSS that you do
not need – Sample
 Minimal comments, comment only what the
code does and not how!
 Use JSON
 Less less less
Presenter: Sathyan, Mindfire Solutions
 Minimize HTTP Requests
 Put Stylesheets at the Top
 Put Scripts at the Bottom
 Avoid Redirects
 Make Ajax Cacheable
 Use GET for AJAX Requests
 Post-load Components
 Preload Components
 Reduce the Number of DOM Elements
Presenter: Sathyan, Mindfire Solutions
 JAX
 What?
 Really?
 AJAX Control Toolkit
 But I need It…
 Callback
 Read
 See
Presenter: Sathyan, Mindfire Solutions
Presenter: Sathyan, Mindfire Solutions
 CSS Sprites
 http://www.websiteoptimization.com/speed/
tweak/css-sprites/
 Replace graphic rollovers with CSS rollovers
 colored backgrounds, borders, or spacing
instead of graphic techniques
 Replace graphic text headers with CSS text
headers
Presenter: Sathyan, Mindfire Solutions
 Use efficient CSS selectors
◦ Right to left $(“body #container div a”)
◦ Rules with descendants body * {...}.hide-scrollbars * {...}
◦ Rules with child or adjacent selectors body > * {...}.hide-
scrollbars * {...}
◦ Rules with overly qualified selectors – IDs with tags
◦ Remove redundant qualifiers.
 Avoid CSS expressions [ IE 5 – 7]
 Put CSS in the document head
 Specify image dimensions
 Specify a character set
Presenter: Sathyan, Mindfire Solutions
 CSS 3 ?
 Group Similar Styles
 Reduce No of line breaks
 Simple colors #333333, #DDDDDD, #112255, #AABBCC, #FF0000
to #333, #DDD, #125, #ABC, #F00
 Remove “px”
 Images
Presenter: Sathyan, Mindfire Solutions
 Scroll, Resize 
 Chrome Developer Tools – Profiles – flipkart
 CSS Stress Test
 Chrome Developer Tools – Timeline Ctrl E R
flipkart
 Chrome Developer Tools –Audit
Presenter: Sathyan, Mindfire Solutions
 Native JS Code
 Grouping
 Reuse
 Caching
 Refer an element as directly as possible using
the ID selector rather than using search/find
in a container, yes that is right, because it
translates directly to good old
getElementByID()
 Concat with Array.prototype.join() – Really?
 Data Structures Push() pop() Shift() - Read
 Use ‘this’
 Switch it!
 Loops $.each() Vs Native
 Initializing instance variables
 Know your Closures
 Cache – $(".someelement") -- Assign to a Var!
Presenter: Sathyan, Mindfire Solutions
Presenter: Sathyan, Mindfire Solutions
 Always Unbind before binding
 Most abused part
 Leads to repeated calls
 Repeated requests leads to pathetic web page
 See
 DOM Manipulation is BAD
for (var ct=0; ct <1000; ++ct)
{
$("#header").html($("#header").html() + ‘something from resultset’);
}
should be written as:
var fullHeaderContent = $("#header").html();
for (var ct=0; ct <1000; ++ct)
{
fullHeaderContent += ‘something from resultset’;
}
$("#header").html(fullHeaderContent );
Presenter: Sathyan, Mindfire Solutions
//BAD
for (var ctPatient=0; ctPatient<=rows.length; ++ctPatient)
{
$('#alertResult').append('<tr><td>'+rows[ctPatient]+'</td></tr>');
}
// AWESOME
var domTree = '';
for (var ctPatient=0; ctPatient<=rows.length; ++ctPatient)
{
domTree += '<tr><td>'+rows[ctPatient]+'</td></tr>';
}
$('#alertResult').append(domTree);
Presenter: Sathyan, Mindfire Solutions
Presenter: Sathyan, Mindfire Solutions
 Avoid using pseudo and attribute selectors
◦ $(‘:visible, :hidden’); $(’[attribute=value]’);
 Class Selectors Next Slower [IE9]
 Tags!
 ID ID ID ID
 Chaining – Multi Selectors
 Sizzle
 Depth of call stack
 Rapid fire rounds – 2 to 3 milliseconds
 Even bubbling – Super Post
 Mouseup Vs Click
Presenter: Sathyan, Mindfire Solutions
$("#longlist li").on("mouseenter", function() { $(this).text("Click
me!");
});
$("#longlist li").on("click", function() { $(this).text("Why did you click
me?!");
});
var list = $("#longlist");
list.on("mouseenter", "li", function(){
$(this).text("Click me!");
});
list.on("click", "li", function() {
$(this).text("Why did you click me?!");
});
http://gregfranko.com/jquery-best-practices/#/20
 Hello World!
 Why?
 Options?
 Window Events?
Presenter: Sathyan, Mindfire Solutions
 It matters
 The latest is the greatest, always
Presenter: Sathyan, Mindfire Solutions
 The best Javascript debugger out there!
 Console shows warning, errors, info
 Look for Yellow and Red – If you see them,
they are bad, get rid of those warnings, errors
right away!
 Do you see 404? Bad, Very Bad, Please act on
it
 Are there repeated calls? No use of “stressing”
the point here, get rid of duplicate calls.
 Net Tab – Wait time - receive time
Presenter: Sathyan, Mindfire Solutions
 Asynch Calls for Wait time
 Number of requests – can they be reduced?
Are there repeated calls? Where is the most
time spent?
 Categorize the bottlenecks using the waterfall
charts
 console.profile, console.time and other
Console APIs are very powerful, learn and use
http://getfirebug.com/wiki/index.php/Conso
le_API
Presenter: Sathyan, Mindfire Solutions
 Yslow
◦ Use a Content Delivery Network (CDN)
◦ Add Expires headers
◦ Avoid empty src or href
◦ Compress components with gzip
◦ Configure entity tags (ETags)
◦ Make favicon small and cacheable
◦ Minification
◦ Bundling
◦ One Big JS/CSS
Presenter: Sathyan, Mindfire Solutions
 uniform way to analyze and report on the
degree to which measured performance
meets user expectations.
 Set Your Apdex Score
 Et Your Apdex Score
Presenter: Sathyan, Mindfire Solutions
 Chrome Developer Tools – Audit
 Miniprofiler
 Glimpse
 Firebug - Network
 Yslow
 PageSpeed
 Newrelic
 http://www.webpagetest.org/
 https://code.google.com/p/leak-finder-for-
javascript/
Presenter: Sathyan, Mindfire Solutions
Presenter: Sathyan, Mindfire Solutions
Presenter: Sathyan, Mindfire Solutions
 http://www.stevesouders.com
 http://www.websiteoptimization.com/
 http://www.webpagetest.org/
 http://webdevchecklist.com/asp.net/performance/
 http://www.strangeloopnetworks.com/assets/images/visualizing_web_performance_pos
ter.jpg
 https://developers.google.com/speed/pagespeed/?csw=1
 https://developers.google.com/speed/docs/best-practices/rendering
 http://oreilly.com/server-administration/excerpts/even-faster-websites/writing-
efficient-javascript.html
 http://gregfranko.com/jquery-best-practices/#/
 http://www.artzstudio.com/2009/04/jquery-performance-rules/
 http://vimeo.com/43659068
 http://addyosmani.com/blog/
 http://www.webperformancetoday.com/2010/07/09/waterfalls-101/
Presenter: Sathyan, Mindfire Solutions
Question and Answer
 HTML5?
 Local Storage?
 Web Sockets?
 http://phantomjs.org/
 Node.js
 Backbone.js
Presenter: Sathyan, Mindfire Solutions
Thank you

Mais conteúdo relacionado

Semelhante a Performance Best Practices - Part 1 - Client Side [JS, CSS, HTML, jQuery]

AtlasCamp 2011 - Five Strategies to Accelerate Plugin Development
AtlasCamp 2011 - Five Strategies to Accelerate Plugin DevelopmentAtlasCamp 2011 - Five Strategies to Accelerate Plugin Development
AtlasCamp 2011 - Five Strategies to Accelerate Plugin Development
mrdon
 
WPF for developers - optimizing your WPF application
WPF for developers - optimizing your WPF applicationWPF for developers - optimizing your WPF application
WPF for developers - optimizing your WPF application
Tamir Khason
 

Semelhante a Performance Best Practices - Part 1 - Client Side [JS, CSS, HTML, jQuery] (20)

AtlasCamp 2011 - Five Strategies to Accelerate Plugin Development
AtlasCamp 2011 - Five Strategies to Accelerate Plugin DevelopmentAtlasCamp 2011 - Five Strategies to Accelerate Plugin Development
AtlasCamp 2011 - Five Strategies to Accelerate Plugin Development
 
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP MeetupWeb Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
 
Introduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopIntroduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint Workshop
 
3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile Web3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile Web
 
Sinatra and JSONQuery Web Service
Sinatra and JSONQuery Web ServiceSinatra and JSONQuery Web Service
Sinatra and JSONQuery Web Service
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
Robotlegs on Top of Gaia
Robotlegs on Top of GaiaRobotlegs on Top of Gaia
Robotlegs on Top of Gaia
 
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
 
Windy cityrails performance_tuning
Windy cityrails performance_tuningWindy cityrails performance_tuning
Windy cityrails performance_tuning
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moon
 
Beyond the Basics, Debugging with Firebug and Web Inspector
Beyond the Basics, Debugging with Firebug and Web InspectorBeyond the Basics, Debugging with Firebug and Web Inspector
Beyond the Basics, Debugging with Firebug and Web Inspector
 
From Zero to Hero – Web Performance
From Zero to Hero – Web PerformanceFrom Zero to Hero – Web Performance
From Zero to Hero – Web Performance
 
Intro to-html-backbone
Intro to-html-backboneIntro to-html-backbone
Intro to-html-backbone
 
Our application got popular and now it breaks
Our application got popular and now it breaksOur application got popular and now it breaks
Our application got popular and now it breaks
 
Our application got popular and now it breaks
Our application got popular and now it breaksOur application got popular and now it breaks
Our application got popular and now it breaks
 
WPF for developers - optimizing your WPF application
WPF for developers - optimizing your WPF applicationWPF for developers - optimizing your WPF application
WPF for developers - optimizing your WPF application
 
(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe
 
Optimizing Flex Applications
Optimizing Flex ApplicationsOptimizing Flex Applications
Optimizing Flex Applications
 
Joomla Day Austin Part 4
Joomla Day Austin Part 4Joomla Day Austin Part 4
Joomla Day Austin Part 4
 

Mais de Mindfire Solutions

Mais de Mindfire Solutions (20)

Physician Search and Review
Physician Search and ReviewPhysician Search and Review
Physician Search and Review
 
diet management app
diet management appdiet management app
diet management app
 
Business Technology Solution
Business Technology SolutionBusiness Technology Solution
Business Technology Solution
 
Remote Health Monitoring
Remote Health MonitoringRemote Health Monitoring
Remote Health Monitoring
 
Influencer Marketing Solution
Influencer Marketing SolutionInfluencer Marketing Solution
Influencer Marketing Solution
 
ELMAH
ELMAHELMAH
ELMAH
 
High Availability of Azure Applications
High Availability of Azure ApplicationsHigh Availability of Azure Applications
High Availability of Azure Applications
 
IOT Hands On
IOT Hands OnIOT Hands On
IOT Hands On
 
Glimpse of Loops Vs Set
Glimpse of Loops Vs SetGlimpse of Loops Vs Set
Glimpse of Loops Vs Set
 
Oracle Sql Developer-Getting Started
Oracle Sql Developer-Getting StartedOracle Sql Developer-Getting Started
Oracle Sql Developer-Getting Started
 
Adaptive Layout In iOS 8
Adaptive Layout In iOS 8Adaptive Layout In iOS 8
Adaptive Layout In iOS 8
 
Introduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/MacIntroduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/Mac
 
LINQPad - utility Tool
LINQPad - utility ToolLINQPad - utility Tool
LINQPad - utility Tool
 
Get started with watch kit development
Get started with watch kit developmentGet started with watch kit development
Get started with watch kit development
 
Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
 
Material Design in Android
Material Design in AndroidMaterial Design in Android
Material Design in Android
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
 
Ext js Part 2- MVC
Ext js Part 2- MVCExt js Part 2- MVC
Ext js Part 2- MVC
 
ExtJs Basic Part-1
ExtJs Basic Part-1ExtJs Basic Part-1
ExtJs Basic Part-1
 
Spring Security Introduction
Spring Security IntroductionSpring Security Introduction
Spring Security Introduction
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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...
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.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]Digital Global Overview Report 2024 Meltwater.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 

Performance Best Practices - Part 1 - Client Side [JS, CSS, HTML, jQuery]

  • 1. Performance Best Practices - Part 1 - Client Side [JS, CSS, HTML, jQuery] Presenter: Sathyan, Mindfire Solutions Date: 03rd Sep 2013
  • 3. Presenter: Sathyan, Mindfire Solutions  Average Frontend time is 75% and above  No inline JavaScript  No Inline Styles  Refer only the necessary include [js, css, etc.] files for the page  Always remove code, DOM, CSS that you do not need – Sample  Minimal comments, comment only what the code does and not how!  Use JSON  Less less less
  • 4. Presenter: Sathyan, Mindfire Solutions  Minimize HTTP Requests  Put Stylesheets at the Top  Put Scripts at the Bottom  Avoid Redirects  Make Ajax Cacheable  Use GET for AJAX Requests  Post-load Components  Preload Components  Reduce the Number of DOM Elements
  • 6.  JAX  What?  Really?  AJAX Control Toolkit  But I need It…  Callback  Read  See Presenter: Sathyan, Mindfire Solutions
  • 7. Presenter: Sathyan, Mindfire Solutions  CSS Sprites  http://www.websiteoptimization.com/speed/ tweak/css-sprites/  Replace graphic rollovers with CSS rollovers  colored backgrounds, borders, or spacing instead of graphic techniques  Replace graphic text headers with CSS text headers
  • 8. Presenter: Sathyan, Mindfire Solutions  Use efficient CSS selectors ◦ Right to left $(“body #container div a”) ◦ Rules with descendants body * {...}.hide-scrollbars * {...} ◦ Rules with child or adjacent selectors body > * {...}.hide- scrollbars * {...} ◦ Rules with overly qualified selectors – IDs with tags ◦ Remove redundant qualifiers.  Avoid CSS expressions [ IE 5 – 7]  Put CSS in the document head  Specify image dimensions  Specify a character set
  • 9. Presenter: Sathyan, Mindfire Solutions  CSS 3 ?  Group Similar Styles  Reduce No of line breaks  Simple colors #333333, #DDDDDD, #112255, #AABBCC, #FF0000 to #333, #DDD, #125, #ABC, #F00  Remove “px”  Images
  • 10. Presenter: Sathyan, Mindfire Solutions  Scroll, Resize   Chrome Developer Tools – Profiles – flipkart  CSS Stress Test  Chrome Developer Tools – Timeline Ctrl E R flipkart  Chrome Developer Tools –Audit
  • 11. Presenter: Sathyan, Mindfire Solutions  Native JS Code  Grouping  Reuse  Caching  Refer an element as directly as possible using the ID selector rather than using search/find in a container, yes that is right, because it translates directly to good old getElementByID()
  • 12.  Concat with Array.prototype.join() – Really?  Data Structures Push() pop() Shift() - Read  Use ‘this’  Switch it!  Loops $.each() Vs Native  Initializing instance variables  Know your Closures  Cache – $(".someelement") -- Assign to a Var! Presenter: Sathyan, Mindfire Solutions
  • 13. Presenter: Sathyan, Mindfire Solutions  Always Unbind before binding  Most abused part  Leads to repeated calls  Repeated requests leads to pathetic web page  See
  • 14.  DOM Manipulation is BAD for (var ct=0; ct <1000; ++ct) { $("#header").html($("#header").html() + ‘something from resultset’); } should be written as: var fullHeaderContent = $("#header").html(); for (var ct=0; ct <1000; ++ct) { fullHeaderContent += ‘something from resultset’; } $("#header").html(fullHeaderContent ); Presenter: Sathyan, Mindfire Solutions
  • 15. //BAD for (var ctPatient=0; ctPatient<=rows.length; ++ctPatient) { $('#alertResult').append('<tr><td>'+rows[ctPatient]+'</td></tr>'); } // AWESOME var domTree = ''; for (var ctPatient=0; ctPatient<=rows.length; ++ctPatient) { domTree += '<tr><td>'+rows[ctPatient]+'</td></tr>'; } $('#alertResult').append(domTree); Presenter: Sathyan, Mindfire Solutions
  • 16. Presenter: Sathyan, Mindfire Solutions  Avoid using pseudo and attribute selectors ◦ $(‘:visible, :hidden’); $(’[attribute=value]’);  Class Selectors Next Slower [IE9]  Tags!  ID ID ID ID  Chaining – Multi Selectors  Sizzle
  • 17.  Depth of call stack  Rapid fire rounds – 2 to 3 milliseconds  Even bubbling – Super Post  Mouseup Vs Click Presenter: Sathyan, Mindfire Solutions
  • 18. $("#longlist li").on("mouseenter", function() { $(this).text("Click me!"); }); $("#longlist li").on("click", function() { $(this).text("Why did you click me?!"); }); var list = $("#longlist"); list.on("mouseenter", "li", function(){ $(this).text("Click me!"); }); list.on("click", "li", function() { $(this).text("Why did you click me?!"); }); http://gregfranko.com/jquery-best-practices/#/20
  • 19.  Hello World!  Why?  Options?  Window Events? Presenter: Sathyan, Mindfire Solutions
  • 20.  It matters  The latest is the greatest, always Presenter: Sathyan, Mindfire Solutions
  • 21.  The best Javascript debugger out there!  Console shows warning, errors, info  Look for Yellow and Red – If you see them, they are bad, get rid of those warnings, errors right away!  Do you see 404? Bad, Very Bad, Please act on it  Are there repeated calls? No use of “stressing” the point here, get rid of duplicate calls.  Net Tab – Wait time - receive time Presenter: Sathyan, Mindfire Solutions
  • 22.  Asynch Calls for Wait time  Number of requests – can they be reduced? Are there repeated calls? Where is the most time spent?  Categorize the bottlenecks using the waterfall charts  console.profile, console.time and other Console APIs are very powerful, learn and use http://getfirebug.com/wiki/index.php/Conso le_API Presenter: Sathyan, Mindfire Solutions
  • 23.  Yslow ◦ Use a Content Delivery Network (CDN) ◦ Add Expires headers ◦ Avoid empty src or href ◦ Compress components with gzip ◦ Configure entity tags (ETags) ◦ Make favicon small and cacheable ◦ Minification ◦ Bundling ◦ One Big JS/CSS Presenter: Sathyan, Mindfire Solutions
  • 24.  uniform way to analyze and report on the degree to which measured performance meets user expectations.  Set Your Apdex Score  Et Your Apdex Score Presenter: Sathyan, Mindfire Solutions
  • 25.  Chrome Developer Tools – Audit  Miniprofiler  Glimpse  Firebug - Network  Yslow  PageSpeed  Newrelic  http://www.webpagetest.org/  https://code.google.com/p/leak-finder-for- javascript/ Presenter: Sathyan, Mindfire Solutions
  • 27. Presenter: Sathyan, Mindfire Solutions  http://www.stevesouders.com  http://www.websiteoptimization.com/  http://www.webpagetest.org/  http://webdevchecklist.com/asp.net/performance/  http://www.strangeloopnetworks.com/assets/images/visualizing_web_performance_pos ter.jpg  https://developers.google.com/speed/pagespeed/?csw=1  https://developers.google.com/speed/docs/best-practices/rendering  http://oreilly.com/server-administration/excerpts/even-faster-websites/writing- efficient-javascript.html  http://gregfranko.com/jquery-best-practices/#/  http://www.artzstudio.com/2009/04/jquery-performance-rules/  http://vimeo.com/43659068  http://addyosmani.com/blog/  http://www.webperformancetoday.com/2010/07/09/waterfalls-101/
  • 28. Presenter: Sathyan, Mindfire Solutions Question and Answer  HTML5?  Local Storage?  Web Sockets?  http://phantomjs.org/  Node.js  Backbone.js
  • 29. Presenter: Sathyan, Mindfire Solutions Thank you