SlideShare a Scribd company logo
CIGNEX Datamatics Confidential www.cignex.com
Web Performance Tuning in Front-end Perspective
Ver : 1.0
Name: Sendhil Kumar K
Title: Web Performance Tuning
in Front-end Perspective
CIGNEX Datamatics Confidential www.cignex.com
• 80% of the end-user response time is spent on the front-end. Most of this time is tied
up in downloading all the components in the page: images, stylesheets, scripts, Flash,
etc.
2
Best Practices for Speeding Up Your Web Site
CIGNEX Datamatics Confidential www.cignex.com
Why is speed important?
• Offers a good user experience
• No broken functionality
• Doesn't make one feel like they are living in the 90s
CIGNEX Datamatics Confidential www.cignex.com
Cross-platform
CIGNEX Datamatics Confidential www.cignex.com
JS Minification
/**
* This, friends, is a very important function.
*/
function examplefunction(){
var be = true;
if(be){
confirm("You sure about that?");
}else if(!be){
Confirm("Apparently not.")
}
}
function examplefunction(){var be=true;if(be)
{confirm("You sure about that?");}else if(!be)
{Confirm("Apparently not.")}};
• Reduce the size of the Javascript files.
• Reduce the total response sizes.
• Reduced bandwidth significantly
Original size: 205 Minified size: 121 41%
CIGNEX Datamatics Confidential www.cignex.com
JS Obfuscation (harder to understand)
function exampleFunction(){
Var aLongerThanNecessaryVariableName =
true;
if(aLongerThanNecessaryVariableName){
confirm("You sure about that?");
}else if(!aLongerThanNecessaryVariableName){
confirm("Apparently not.");
}
}
function exampleFunction(){
Var a = true;
if(a){
confirm("You sure about that?");
}else if(!a){
confirm("Apparently not.");
}
}
• Reduce the lenght of variables names
• Be careful the obfuscation method (e.g., eval cause performance degradation)
• Be careful the conflicts.
Original size: 238 Obfuscation size: 145 39%
CIGNEX Datamatics Confidential www.cignex.com
Combined (css, js)
CSS
<link href="./css/custom.css" rel="stylesheet" type="text/css">
<link href="./css/custom_responsive.css" rel="stylesheet" type="text/css">
JS
<script src="./js/custom.js"></script>
<script src="./js/custom_responsive.js"></script>
<link href="./css/combination.css" rel="stylesheet" type="text/css">
<script src="./js/combination.js"></script>
• Reduce the HTTP requrest.
• Reduce the size and load fast
CIGNEX Datamatics Confidential www.cignex.com
<head>
<link href="./css/custom.css" rel="stylesheet" type="text/css">
<link href="./css/custom_responsive.css" rel="stylesheet" type="text/css">
</head>
<body>
..
..
<script src="./js/custom.js" type="text/javascript"></script>
<script src="./js/custom_responsive.js" type="text/javascript"></script>
</body>
Source Order
<head>
<script src="./js/custom.js"></script>
<script src="./js/custom_responsive.js"></script>
<link href="./css/custom.css" rel="stylesheet" type="text/css">
<link href="./css/custom_responsive.css" rel="stylesheet"
type="text/css">
</head>
<body>
..
..
</body>
• Keep CSS at Top
• Keep JavaScripts at the Bottom
• Drop all inline styles if possible and don't use browser specific CSS effects (esp. IE)
• Use <link> to include stylesheets
- @import MUST preceded all other rules
- @import may cause blank white screen phenomenon (in IE)
CIGNEX Datamatics Confidential www.cignex.com
• CSS Sprites: Combine N icons into 1 bigger image.
– Reduce N requests into 1 requrest.
– Be careful of the arrangement of the icons
– Tool: http://www.tw.spritegen.website-performance.org/
http://csssprites.com/
• Minimize, cut snip, chop
– Minimize DOM elements. Slows donw JS
– Iframes are heavy and block onload event
– Minimize 3rd party script. See if you load those asynchronously
– Reduce the cookie size.
– Optimize images, use PNG instead of GIF.
– Using appropriate image format and remove redundant chunks in the image files.
– PNG8 (256 color) is a good choice.
– Reduce JPG quality. Tools like jpgtran, pngcrush, optipng will help
– Avoid image scaling
9
Make Fewer Requests
CIGNEX Datamatics Confidential www.cignex.com
– Use JSON in AJAX requests
– Use GET in Ajax requests
– Prefer CSS over JSON
– Font optimizing
– Lazy load for Images
– Avoid Flash files
– Mobile-specific optimisations
Make Fewer Requests ( Minimize, cut snip, chop...)
CIGNEX Datamatics Confidential www.cignex.com
Browser-Based Tools
CIGNEX Datamatics Confidential www.cignex.com
YSlow (Add-on)
http://developer.yahoo.com/yslow/
• YSlow analyzes web page performance by examining all the components on the
page, including components dynamically created by using JavaScript. It measures the
page's performance and offers suggestions for improvement.
CIGNEX Datamatics Confidential www.cignex.com
Page Speed
• Useful to detect our website performance
• Gives two scores: desktop and mobile
• LIsts everything we can improve
https://developers.google.com/speed/pagespeed/?csw=1
Firefox Add-on
CIGNEX Datamatics Confidential www.cignex.com
Other tools
• FireBug (Net tab)
• Firecookie (Firecookie is an extension for Firebug that makes possible to view and manage cookies in
your browser)
• Live HTTP Headers (View HTTP headers of a page and while browsing.)
• Chrome, Safari, IE developer tools
CIGNEX Datamatics Confidential www.cignex.com
List of best practices
CIGNEX Datamatics Confidential www.cignex.com
Simplifying CSS Selectors
• CSS selector policy: Rightmost-First
• Tips:
– Avoid * selector
– Don’t qualify ID/CSS selectors
– Specific rules
– Avoid descendant selectors
– Avoid Tag > Child selectors
– Rely on Inheritance
CIGNEX Datamatics Confidential www.cignex.com
 http://developer.yahoo.com/performance/rules.html - Yahoo
 http://developer.mozilla.org/en/docs/Writing_Efficient_CSS - CSS Guidelines
 http://www.alistapart.com/articles/sprites - CSS Sprites
 http://www.javascripttoolbox.com/bestpractices/ - Javascript best practices
 http://www.getfirebug.com/ - FireBug
 http://www.julienlecomte.net/ - A nice blog
 http://stevesouders.com/cuzillion/ - Place scripts & other resources tester
 http://quirksmode.org/
 Other references: Jquery, GWT, YUI, Ajaxian
 Future - Ajax tied up with desktop web, other gadgets.
 Douglaus crockford - Yahoo videos about Javascript, DOM, Advanced JS
 Google I/O videos about web site performance tuning.
Referances

More Related Content

PPTX
PPTX
Web performance
PPTX
Web Cache Deception Attack
ODP
Introduction to KSS
PDF
Building Progressive Web Apps for Android and iOS
PDF
Universal React apps in Next.js
PDF
Battling Google PageSpeed Insights
PDF
Polymer vs other libraries (Devfest Ukraine 2015)
Web performance
Web Cache Deception Attack
Introduction to KSS
Building Progressive Web Apps for Android and iOS
Universal React apps in Next.js
Battling Google PageSpeed Insights
Polymer vs other libraries (Devfest Ukraine 2015)

What's hot (20)

PDF
NextJS, A JavaScript Framework for building next generation SPA
PPT
Client Side Performance @ Xero
PDF
AEM responsive
PPTX
Building fast aspnet websites
PPTX
Optimizing WordPress for Speed and Conversions
PDF
jQuery 1.9 and 2.0 - Present and Future
PDF
Progressive Web Apps: o melhor da Web appficada
PPTX
DeepCrawl Webinar: Performing SEO on the Edge
PDF
Next.js in production by Jasdeep Lalli
PPTX
How webpage loading takes place?
PDF
Performance Test Analysis- Hotels
PPTX
Client side performance analysis
PPTX
PPTX
10 things to do to speed up your site
PDF
Responsive design in plone
PPTX
Why AngularJs
PPTX
BrightonSEO 2019 - Edge SEO - Using CDNs To Perform SEO On The Edge
PPTX
Web Performance: 3 Stages to Success
PPTX
Angular js
PDF
Effectively Monitoring Client-Side Performance
NextJS, A JavaScript Framework for building next generation SPA
Client Side Performance @ Xero
AEM responsive
Building fast aspnet websites
Optimizing WordPress for Speed and Conversions
jQuery 1.9 and 2.0 - Present and Future
Progressive Web Apps: o melhor da Web appficada
DeepCrawl Webinar: Performing SEO on the Edge
Next.js in production by Jasdeep Lalli
How webpage loading takes place?
Performance Test Analysis- Hotels
Client side performance analysis
10 things to do to speed up your site
Responsive design in plone
Why AngularJs
BrightonSEO 2019 - Edge SEO - Using CDNs To Perform SEO On The Edge
Web Performance: 3 Stages to Success
Angular js
Effectively Monitoring Client-Side Performance
Ad

Viewers also liked (8)

PDF
PDF
Stats stif-transports-idf-janvier-2016-2
PPTX
Front end performance optimization
PDF
Front end performance tip
PDF
Building a High Performance WordPress Environment - WordCamp NYC 2010
PDF
Front End Performance
PPTX
London Web Performance Meetup: Performance for mortal companies
PPT
Bootstrap with liferay
Stats stif-transports-idf-janvier-2016-2
Front end performance optimization
Front end performance tip
Building a High Performance WordPress Environment - WordCamp NYC 2010
Front End Performance
London Web Performance Meetup: Performance for mortal companies
Bootstrap with liferay
Ad

Similar to Web performance tuning (20)

PPTX
The High Performance Web Application Lifecycle
PDF
12 GoMeasure (sg and kl) - page speed light speed path to conversions - joh...
PPTX
Presentation Tier optimizations
PDF
Custom Web Design Vs Website Templates Which One Is Right
PDF
Build Better Responsive websites. Hrvoje Jurišić
PPTX
Optimizing your WordPress website
PPTX
Modelling Web Performance Optimization - FFSUx
PDF
[convergese] Adaptive Images in Responsive Web Design
PPTX
The Need for Speed - SMX Sydney 2013
PDF
VizEx View HTML5 Workshop
PDF
VizEx View HTML5 Workshop
PPTX
Website Optimization How to Increase Page Performance and More
PPTX
221c82d4-5428-4047-8558-0467b34083e8.pptx
PDF
20 tips for website performance
KEY
Developing High Performance Web Apps - CodeMash 2011
PPTX
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
PDF
PrairieDevCon 2014 - Web Doesn't Mean Slow
PPT
performance.ppt
PDF
Developing High Performance Web Apps
PPTX
JavaScript front end performance optimizations
The High Performance Web Application Lifecycle
12 GoMeasure (sg and kl) - page speed light speed path to conversions - joh...
Presentation Tier optimizations
Custom Web Design Vs Website Templates Which One Is Right
Build Better Responsive websites. Hrvoje Jurišić
Optimizing your WordPress website
Modelling Web Performance Optimization - FFSUx
[convergese] Adaptive Images in Responsive Web Design
The Need for Speed - SMX Sydney 2013
VizEx View HTML5 Workshop
VizEx View HTML5 Workshop
Website Optimization How to Increase Page Performance and More
221c82d4-5428-4047-8558-0467b34083e8.pptx
20 tips for website performance
Developing High Performance Web Apps - CodeMash 2011
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
PrairieDevCon 2014 - Web Doesn't Mean Slow
performance.ppt
Developing High Performance Web Apps
JavaScript front end performance optimizations

Recently uploaded (20)

PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PDF
The Internet -By the Numbers, Sri Lanka Edition
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PDF
Triggering QUIC, presented by Geoff Huston at IETF 123
PPTX
Introduction to Information and Communication Technology
PPTX
Digital Literacy And Online Safety on internet
PDF
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PPTX
Funds Management Learning Material for Beg
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PDF
Sims 4 Historia para lo sims 4 para jugar
PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
introduction about ICD -10 & ICD-11 ppt.pptx
The Internet -By the Numbers, Sri Lanka Edition
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Tenda Login Guide: Access Your Router in 5 Easy Steps
WebRTC in SignalWire - troubleshooting media negotiation
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Triggering QUIC, presented by Geoff Huston at IETF 123
Introduction to Information and Communication Technology
Digital Literacy And Online Safety on internet
Slides PDF The World Game (s) Eco Economic Epochs.pdf
Funds Management Learning Material for Beg
Decoding a Decade: 10 Years of Applied CTI Discipline
Sims 4 Historia para lo sims 4 para jugar
Cloud-Scale Log Monitoring _ Datadog.pdf
An introduction to the IFRS (ISSB) Stndards.pdf
INTERNET------BASICS-------UPDATED PPT PRESENTATION
SASE Traffic Flow - ZTNA Connector-1.pdf
Design_with_Watersergyerge45hrbgre4top (1).ppt
Job_Card_System_Styled_lorem_ipsum_.pptx

Web performance tuning

  • 1. CIGNEX Datamatics Confidential www.cignex.com Web Performance Tuning in Front-end Perspective Ver : 1.0 Name: Sendhil Kumar K Title: Web Performance Tuning in Front-end Perspective
  • 2. CIGNEX Datamatics Confidential www.cignex.com • 80% of the end-user response time is spent on the front-end. Most of this time is tied up in downloading all the components in the page: images, stylesheets, scripts, Flash, etc. 2 Best Practices for Speeding Up Your Web Site
  • 3. CIGNEX Datamatics Confidential www.cignex.com Why is speed important? • Offers a good user experience • No broken functionality • Doesn't make one feel like they are living in the 90s
  • 4. CIGNEX Datamatics Confidential www.cignex.com Cross-platform
  • 5. CIGNEX Datamatics Confidential www.cignex.com JS Minification /** * This, friends, is a very important function. */ function examplefunction(){ var be = true; if(be){ confirm("You sure about that?"); }else if(!be){ Confirm("Apparently not.") } } function examplefunction(){var be=true;if(be) {confirm("You sure about that?");}else if(!be) {Confirm("Apparently not.")}}; • Reduce the size of the Javascript files. • Reduce the total response sizes. • Reduced bandwidth significantly Original size: 205 Minified size: 121 41%
  • 6. CIGNEX Datamatics Confidential www.cignex.com JS Obfuscation (harder to understand) function exampleFunction(){ Var aLongerThanNecessaryVariableName = true; if(aLongerThanNecessaryVariableName){ confirm("You sure about that?"); }else if(!aLongerThanNecessaryVariableName){ confirm("Apparently not."); } } function exampleFunction(){ Var a = true; if(a){ confirm("You sure about that?"); }else if(!a){ confirm("Apparently not."); } } • Reduce the lenght of variables names • Be careful the obfuscation method (e.g., eval cause performance degradation) • Be careful the conflicts. Original size: 238 Obfuscation size: 145 39%
  • 7. CIGNEX Datamatics Confidential www.cignex.com Combined (css, js) CSS <link href="./css/custom.css" rel="stylesheet" type="text/css"> <link href="./css/custom_responsive.css" rel="stylesheet" type="text/css"> JS <script src="./js/custom.js"></script> <script src="./js/custom_responsive.js"></script> <link href="./css/combination.css" rel="stylesheet" type="text/css"> <script src="./js/combination.js"></script> • Reduce the HTTP requrest. • Reduce the size and load fast
  • 8. CIGNEX Datamatics Confidential www.cignex.com <head> <link href="./css/custom.css" rel="stylesheet" type="text/css"> <link href="./css/custom_responsive.css" rel="stylesheet" type="text/css"> </head> <body> .. .. <script src="./js/custom.js" type="text/javascript"></script> <script src="./js/custom_responsive.js" type="text/javascript"></script> </body> Source Order <head> <script src="./js/custom.js"></script> <script src="./js/custom_responsive.js"></script> <link href="./css/custom.css" rel="stylesheet" type="text/css"> <link href="./css/custom_responsive.css" rel="stylesheet" type="text/css"> </head> <body> .. .. </body> • Keep CSS at Top • Keep JavaScripts at the Bottom • Drop all inline styles if possible and don't use browser specific CSS effects (esp. IE) • Use <link> to include stylesheets - @import MUST preceded all other rules - @import may cause blank white screen phenomenon (in IE)
  • 9. CIGNEX Datamatics Confidential www.cignex.com • CSS Sprites: Combine N icons into 1 bigger image. – Reduce N requests into 1 requrest. – Be careful of the arrangement of the icons – Tool: http://www.tw.spritegen.website-performance.org/ http://csssprites.com/ • Minimize, cut snip, chop – Minimize DOM elements. Slows donw JS – Iframes are heavy and block onload event – Minimize 3rd party script. See if you load those asynchronously – Reduce the cookie size. – Optimize images, use PNG instead of GIF. – Using appropriate image format and remove redundant chunks in the image files. – PNG8 (256 color) is a good choice. – Reduce JPG quality. Tools like jpgtran, pngcrush, optipng will help – Avoid image scaling 9 Make Fewer Requests
  • 10. CIGNEX Datamatics Confidential www.cignex.com – Use JSON in AJAX requests – Use GET in Ajax requests – Prefer CSS over JSON – Font optimizing – Lazy load for Images – Avoid Flash files – Mobile-specific optimisations Make Fewer Requests ( Minimize, cut snip, chop...)
  • 11. CIGNEX Datamatics Confidential www.cignex.com Browser-Based Tools
  • 12. CIGNEX Datamatics Confidential www.cignex.com YSlow (Add-on) http://developer.yahoo.com/yslow/ • YSlow analyzes web page performance by examining all the components on the page, including components dynamically created by using JavaScript. It measures the page's performance and offers suggestions for improvement.
  • 13. CIGNEX Datamatics Confidential www.cignex.com Page Speed • Useful to detect our website performance • Gives two scores: desktop and mobile • LIsts everything we can improve https://developers.google.com/speed/pagespeed/?csw=1 Firefox Add-on
  • 14. CIGNEX Datamatics Confidential www.cignex.com Other tools • FireBug (Net tab) • Firecookie (Firecookie is an extension for Firebug that makes possible to view and manage cookies in your browser) • Live HTTP Headers (View HTTP headers of a page and while browsing.) • Chrome, Safari, IE developer tools
  • 15. CIGNEX Datamatics Confidential www.cignex.com List of best practices
  • 16. CIGNEX Datamatics Confidential www.cignex.com Simplifying CSS Selectors • CSS selector policy: Rightmost-First • Tips: – Avoid * selector – Don’t qualify ID/CSS selectors – Specific rules – Avoid descendant selectors – Avoid Tag > Child selectors – Rely on Inheritance
  • 17. CIGNEX Datamatics Confidential www.cignex.com  http://developer.yahoo.com/performance/rules.html - Yahoo  http://developer.mozilla.org/en/docs/Writing_Efficient_CSS - CSS Guidelines  http://www.alistapart.com/articles/sprites - CSS Sprites  http://www.javascripttoolbox.com/bestpractices/ - Javascript best practices  http://www.getfirebug.com/ - FireBug  http://www.julienlecomte.net/ - A nice blog  http://stevesouders.com/cuzillion/ - Place scripts & other resources tester  http://quirksmode.org/  Other references: Jquery, GWT, YUI, Ajaxian  Future - Ajax tied up with desktop web, other gadgets.  Douglaus crockford - Yahoo videos about Javascript, DOM, Advanced JS  Google I/O videos about web site performance tuning. Referances