SlideShare une entreprise Scribd logo
1  sur  52
Télécharger pour lire hors ligne
Front-end Performance
         Tips


    !quot;#$!%&'()*!+,-
Agenda

• Why Front-End?
• Loading phase
• Rendering phase
• Running phase
• Conclusion
Why Front-End?
Back-End vs. Front-End
• Performance Optimization
 • Back-end
 • Front-end
Back-End vs. Front-End
• Performance Optimization
 • Back-end
 • Front-end      1.969 sec




 0.099 sec            HTML loading time : 5%
Loading
Minimize HTTP Requests
 • Most Important Guideline
 • Performance Tuning
  • Same Contents
  • Low HTTP Request (=Connection)
 • Techniques
  • Simple Design
  • Combine Image/CSS/JavaScript
100


 75


 50


 25


  0
      html   iframe     flash   js        css   css image image

      Daum            Naver          Cyworld        Yahoo kr



              Request Stats.
                                                        by YSlow
Image

• Image map
• CSS Sprite
 • CSS width, height, background property
• Inline image
 • Base64 encoded image data URL format
<span style=“background-image:url('sprites.gif');
  background-position:-260px -90px;
  width:10px;height:10pxquot;></span>
CSS sprite - tv!
CSS sprite - tv!
CSS sprite - tv!
CSS sprite - tv!
CSS sprite - tv!
CSS sprite - YouTube
CSS sprite - YouTube
<img width=”10” height=”10” src=”p.gif”
style=”background:url(bg.gif)”/>
JavaScript/CSS combine

• JavaScript
 • variable, function conflict
• CSS
 • selector conflict
 • media=”print” ! @media print { }
@media rule
page.html
  <link ... href=”style.css” />
  <link ... href=”print.css” media=”print” />




page.html
  <link ... href=”style.css” />
style.css
  #wrap { … }
  @media print {
    #wrap { … }
  }
On demand loading

• Ajax
• Post Image loading
• Post JavaScript / CSS loading
Post image loading
Post image loading
<div onscroll=”deferLoad(‘key’)”><ul>
  <li><img src=”image1.gif” /></li>
  ...
  <li><img src=”blank.gif”
    onload=”registerDeferImg(‘key’,
    this,’image3.gif’)” /></li>
   ...
</ul></div>
Cookie

• Remove unnecessary cookie
• Set expire date
• Check domain level
• Separate static / dynamic resource domain
Rendering
Initial Layout

• Depend on HTML / CSS not JavaScript
• quot;# $ %& '(
 • Window/Frame size
 • Not fully supported css property
JavaScript Block Downloading
 • Move To Bottom
JavaScript block rendering
FOUC & Blank White Screen

 • Why?
  • @import or <link> at bottom
 • Blank White Screen
  • New Window / Homepage
 • Move To Top
FOUC & Blank White Screen
AlphaImageLoader filter

• Rendering Semi-transparent PNG24
• Problem
 •   Block Loading & Rendering, Freeze Browser

 • link & mouse pointer
• Solution
 •   IE conditional comment & IE6 ‘_’ hack
 •   a { position:relative; cursor:pointer; }
AlphaImageLoader demo
PNG24
AlphaImageLoader filter
            IE conditional comment
style.css
.png {background:transparent url(img.png) 0 0 no-repeat;}


page.html
<!--[if lte IE 6]>
<style type=”text/css”>
.png { background-image:none; filter:progid:
  DXImageTransform.Microsoft.AlphaImageLoader(
  src='img.png',sizingMethod='scale'); }
</style>
<![endif]-->
Efficient CSS selector

• Avoid universal rule
• Don't qualify ID-categorized rules with tag
  names or classes
• Avoid the descendant selector
• Rely on inheritance
Running
CSS expression
font-size:
     expression(document.body.clientWidth/10+‘px’);


• IE proprietary
• Continuously run when
   mousemove, keypress, resize, scroll event
• Solution / Alternate
 • One-time expression
 • Event Handling
Background Flickering

• :hover (mouse over) action
• IE6
 • Flickering
 • Re-Request
• http://fivesevensix.com/studies/ie6flicker/
Flickering demo
Background flickering Solution

• JavaScript
  document.execCommand(quot;BackgroundImageCachequot;,
    false, true);


• CSS
  html { filter:expression(document.execCommand(
    quot;BackgroundImageCachequot;, false, true)); }


• Web Server - Apache
  BrowserMatch quot;MSIEquot; brokenvary=1
  BrowserMatch quot;Mozilla/4.[0-9]{2}quot; brokenvary=1
  BrowserMatch quot;Operaquot; !brokenvary
  SetEnvIf brokenvary 1 force-no-vary
String Handling
• Concatenation
 • + operator ! array.join()
• Search
 • regexp ! string.indexOf()
• Regular Expression
 • new RegExp() ! / ~ / literal
DOM Access

• Minimize DOM access
• Offline access
• Reuse reference
50x50 table creation
           W3C DOM     Table methods           innerHTML
                                                                       by Windows XP,
                                                                      Quirksmode.org


    IE6

    IE7

Firefox2

Firefox3

 Opera

  Safari

           0         1,000             2,000               3,000               4,000
                                                                                 ms

                 DOM I/O test
Set Style
• by style property - BAD
   elm.style.backgroundColor = ‘#f00’;
   elm.style.width = ‘20px’;




• by CSS & className property - GOOD
   style.css
    .foo { background-color:#f00; width:20px; }
   script.js
    elm.className = ‘foo’;
4x425(1,700) td style
                      className         style         by Windows XP,
                                                      Quirksmode.org

    IE6

    IE7

Firefox2

Firefox3

 Opera

  Safari

           0    100               200           300               400
                                                                   ms


               Set Style test
JavaScript Framework

• prototype, jQuery,YUI ...
• Performance issue
 • File size
 • Internal object inheritance
• $() vs. document.getElementById()
the Others
•   Cache

•   CDN(Contents Delivery Network)

•   Domain name

    •   DNS lookup

    •   Parallel download

•   ETags

•   Redirect
Tools

• Firebug
• IBM page detailer
• YSlow
• Fiddler
Conclusion
• Front-end Performance
 • Trade-off
 • Service / Client environment
• As UI Developer
 • Unobtrusive JavaScript
 • Development Process
 • Accessibility
References
• YDN Exceptional Performance :
  Best Practices for Speeding Up Your Web Site

• ) *+, -./ 01(High Performance
  Web Sites), 2'3, Steve Souders

• QuirksMode.org
Q/A
Thank you
   suguni@gmail.com
http://yuiworld.kr/suguni

Contenu connexe

Tendances

Use Xdebug to profile PHP
Use Xdebug to profile PHPUse Xdebug to profile PHP
Use Xdebug to profile PHPSeravo
 
Pagespeed what, why, and how it works
Pagespeed   what, why, and how it worksPagespeed   what, why, and how it works
Pagespeed what, why, and how it worksIlya Grigorik
 
A web perf dashboard up & running in 90 minutes presentation
A web perf dashboard up & running in 90 minutes presentationA web perf dashboard up & running in 90 minutes presentation
A web perf dashboard up & running in 90 minutes presentationJustin Dorfman
 
HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?Remy Sharp
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video PlayerJim Jeffers
 
BaláZs Ree Introduction To Kss, Kinetic Style Sheets
BaláZs Ree   Introduction To Kss, Kinetic Style SheetsBaláZs Ree   Introduction To Kss, Kinetic Style Sheets
BaláZs Ree Introduction To Kss, Kinetic Style SheetsVincenzo Barone
 
How to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressHow to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressOtto Kekäläinen
 
AD1387: Outside The Box: Integrating with Non-Domino Apps using XPages and Ja...
AD1387: Outside The Box: Integrating with Non-Domino Apps using XPages and Ja...AD1387: Outside The Box: Integrating with Non-Domino Apps using XPages and Ja...
AD1387: Outside The Box: Integrating with Non-Domino Apps using XPages and Ja...panagenda
 
Administer WordPress with WP-CLI
Administer WordPress with WP-CLIAdminister WordPress with WP-CLI
Administer WordPress with WP-CLISuwash Kunwar
 
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJRealize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJLeonardo Balter
 
Scaling Drupal: Not IF... HOW
Scaling Drupal: Not IF... HOWScaling Drupal: Not IF... HOW
Scaling Drupal: Not IF... HOWTreehouse Agency
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5dynamis
 
Web Page Test - Beyond the Basics
Web Page Test - Beyond the BasicsWeb Page Test - Beyond the Basics
Web Page Test - Beyond the BasicsAndy Davies
 

Tendances (20)

Use Xdebug to profile PHP
Use Xdebug to profile PHPUse Xdebug to profile PHP
Use Xdebug to profile PHP
 
Pagespeed what, why, and how it works
Pagespeed   what, why, and how it worksPagespeed   what, why, and how it works
Pagespeed what, why, and how it works
 
HTML 5 - Overview
HTML 5 - OverviewHTML 5 - Overview
HTML 5 - Overview
 
A web perf dashboard up & running in 90 minutes presentation
A web perf dashboard up & running in 90 minutes presentationA web perf dashboard up & running in 90 minutes presentation
A web perf dashboard up & running in 90 minutes presentation
 
HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?
 
YSlow 2.0
YSlow 2.0YSlow 2.0
YSlow 2.0
 
WordPress and Ajax
WordPress and AjaxWordPress and Ajax
WordPress and Ajax
 
Nodejs.meetup
Nodejs.meetupNodejs.meetup
Nodejs.meetup
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video Player
 
BaláZs Ree Introduction To Kss, Kinetic Style Sheets
BaláZs Ree   Introduction To Kss, Kinetic Style SheetsBaláZs Ree   Introduction To Kss, Kinetic Style Sheets
BaláZs Ree Introduction To Kss, Kinetic Style Sheets
 
How to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressHow to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPress
 
AD1387: Outside The Box: Integrating with Non-Domino Apps using XPages and Ja...
AD1387: Outside The Box: Integrating with Non-Domino Apps using XPages and Ja...AD1387: Outside The Box: Integrating with Non-Domino Apps using XPages and Ja...
AD1387: Outside The Box: Integrating with Non-Domino Apps using XPages and Ja...
 
Liking performance
Liking performanceLiking performance
Liking performance
 
Administer WordPress with WP-CLI
Administer WordPress with WP-CLIAdminister WordPress with WP-CLI
Administer WordPress with WP-CLI
 
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJRealize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
 
Scaling Drupal: Not IF... HOW
Scaling Drupal: Not IF... HOWScaling Drupal: Not IF... HOW
Scaling Drupal: Not IF... HOW
 
Os Pruett
Os PruettOs Pruett
Os Pruett
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5
 
Web Page Test - Beyond the Basics
Web Page Test - Beyond the BasicsWeb Page Test - Beyond the Basics
Web Page Test - Beyond the Basics
 
Os Furlong
Os FurlongOs Furlong
Os Furlong
 

En vedette

Building a High Performance WordPress Environment - WordCamp NYC 2010
Building a High Performance WordPress Environment - WordCamp NYC 2010Building a High Performance WordPress Environment - WordCamp NYC 2010
Building a High Performance WordPress Environment - WordCamp NYC 2010Matt Martz
 
Stats stif-transports-idf-janvier-2016-2
Stats stif-transports-idf-janvier-2016-2Stats stif-transports-idf-janvier-2016-2
Stats stif-transports-idf-janvier-2016-2Quoimaligne Idf
 
London Web Performance Meetup: Performance for mortal companies
London Web Performance Meetup: Performance for mortal companiesLondon Web Performance Meetup: Performance for mortal companies
London Web Performance Meetup: Performance for mortal companiesStrangeloop
 

En vedette (6)

Building a High Performance WordPress Environment - WordCamp NYC 2010
Building a High Performance WordPress Environment - WordCamp NYC 2010Building a High Performance WordPress Environment - WordCamp NYC 2010
Building a High Performance WordPress Environment - WordCamp NYC 2010
 
Stats stif-transports-idf-janvier-2016-2
Stats stif-transports-idf-janvier-2016-2Stats stif-transports-idf-janvier-2016-2
Stats stif-transports-idf-janvier-2016-2
 
git
gitgit
git
 
Web performance tuning
Web performance tuning Web performance tuning
Web performance tuning
 
London Web Performance Meetup: Performance for mortal companies
London Web Performance Meetup: Performance for mortal companiesLondon Web Performance Meetup: Performance for mortal companies
London Web Performance Meetup: Performance for mortal companies
 
Bootstrap with liferay
Bootstrap with liferayBootstrap with liferay
Bootstrap with liferay
 

Similaire à Front-end Performance Tips to Optimize Loading, Rendering & Running Phases

The Future Of CSS
The Future Of CSSThe Future Of CSS
The Future Of CSSAndy Budd
 
CSS and image optimization
CSS and image optimizationCSS and image optimization
CSS and image optimizationStoyan Stefanov
 
Architectures For Scaling Ajax
Architectures For Scaling AjaxArchitectures For Scaling Ajax
Architectures For Scaling Ajaxwolframkriesing
 
High Performance Django 1
High Performance Django 1High Performance Django 1
High Performance Django 1DjangoCon2008
 
High Performance Django
High Performance DjangoHigh Performance Django
High Performance DjangoDjangoCon2008
 
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
New Features Coming in Browsers (RIT '09)
New Features Coming in Browsers (RIT '09)New Features Coming in Browsers (RIT '09)
New Features Coming in Browsers (RIT '09)jeresig
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizationsChris Love
 
Beyond Resizing: The Image Performance Checklist
Beyond Resizing: The Image Performance ChecklistBeyond Resizing: The Image Performance Checklist
Beyond Resizing: The Image Performance ChecklistCloudinary
 
Алексей Швайка "Bundling: you are doing it wrong"
Алексей Швайка "Bundling: you are doing it wrong"Алексей Швайка "Bundling: you are doing it wrong"
Алексей Швайка "Bundling: you are doing it wrong"Fwdays
 
Modern Web Development
Modern Web DevelopmentModern Web Development
Modern Web DevelopmentRobert Nyman
 
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
 
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
 
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
 
Nanoformats
NanoformatsNanoformats
Nanoformatsrozario
 
Performance, Games, and Distributed Testing in JavaScript
Performance, Games, and Distributed Testing in JavaScriptPerformance, Games, and Distributed Testing in JavaScript
Performance, Games, and Distributed Testing in JavaScriptjeresig
 
Ease into HTML5 and CSS3
Ease into HTML5 and CSS3Ease into HTML5 and CSS3
Ease into HTML5 and CSS3Brian Moon
 

Similaire à Front-end Performance Tips to Optimize Loading, Rendering & Running Phases (20)

Coding the UI
Coding the UICoding the UI
Coding the UI
 
Coding Ui
Coding UiCoding Ui
Coding Ui
 
The Future Of CSS
The Future Of CSSThe Future Of CSS
The Future Of CSS
 
CSS and image optimization
CSS and image optimizationCSS and image optimization
CSS and image optimization
 
The Future of CSS
The Future of CSSThe Future of CSS
The Future of CSS
 
Architectures For Scaling Ajax
Architectures For Scaling AjaxArchitectures For Scaling Ajax
Architectures For Scaling Ajax
 
High Performance Django 1
High Performance Django 1High Performance Django 1
High Performance Django 1
 
High Performance Django
High Performance DjangoHigh Performance Django
High Performance Django
 
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design
 
New Features Coming in Browsers (RIT '09)
New Features Coming in Browsers (RIT '09)New Features Coming in Browsers (RIT '09)
New Features Coming in Browsers (RIT '09)
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
Beyond Resizing: The Image Performance Checklist
Beyond Resizing: The Image Performance ChecklistBeyond Resizing: The Image Performance Checklist
Beyond Resizing: The Image Performance Checklist
 
Алексей Швайка "Bundling: you are doing it wrong"
Алексей Швайка "Bundling: you are doing it wrong"Алексей Швайка "Bundling: you are doing it wrong"
Алексей Швайка "Bundling: you are doing it wrong"
 
Modern Web Development
Modern Web DevelopmentModern Web Development
Modern Web Development
 
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
 
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"
 
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
 
Nanoformats
NanoformatsNanoformats
Nanoformats
 
Performance, Games, and Distributed Testing in JavaScript
Performance, Games, and Distributed Testing in JavaScriptPerformance, Games, and Distributed Testing in JavaScript
Performance, Games, and Distributed Testing in JavaScript
 
Ease into HTML5 and CSS3
Ease into HTML5 and CSS3Ease into HTML5 and CSS3
Ease into HTML5 and CSS3
 

Dernier

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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 RobisonAnna Loughnan Colquhoun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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.pdfEnterprise Knowledge
 
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
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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 SolutionsEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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...Enterprise Knowledge
 
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
 

Dernier (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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
 
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
 
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...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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...
 
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
 

Front-end Performance Tips to Optimize Loading, Rendering & Running Phases

  • 1. Front-end Performance Tips !quot;#$!%&'()*!+,-
  • 2. Agenda • Why Front-End? • Loading phase • Rendering phase • Running phase • Conclusion
  • 4. Back-End vs. Front-End • Performance Optimization • Back-end • Front-end
  • 5. Back-End vs. Front-End • Performance Optimization • Back-end • Front-end 1.969 sec 0.099 sec HTML loading time : 5%
  • 7. Minimize HTTP Requests • Most Important Guideline • Performance Tuning • Same Contents • Low HTTP Request (=Connection) • Techniques • Simple Design • Combine Image/CSS/JavaScript
  • 8. 100 75 50 25 0 html iframe flash js css css image image Daum Naver Cyworld Yahoo kr Request Stats. by YSlow
  • 9. Image • Image map • CSS Sprite • CSS width, height, background property • Inline image • Base64 encoded image data URL format
  • 10. <span style=“background-image:url('sprites.gif'); background-position:-260px -90px; width:10px;height:10pxquot;></span>
  • 16. CSS sprite - YouTube
  • 17. CSS sprite - YouTube <img width=”10” height=”10” src=”p.gif” style=”background:url(bg.gif)”/>
  • 18. JavaScript/CSS combine • JavaScript • variable, function conflict • CSS • selector conflict • media=”print” ! @media print { }
  • 19. @media rule page.html <link ... href=”style.css” /> <link ... href=”print.css” media=”print” /> page.html <link ... href=”style.css” /> style.css #wrap { … } @media print { #wrap { … } }
  • 20. On demand loading • Ajax • Post Image loading • Post JavaScript / CSS loading
  • 22. Post image loading <div onscroll=”deferLoad(‘key’)”><ul> <li><img src=”image1.gif” /></li> ... <li><img src=”blank.gif” onload=”registerDeferImg(‘key’, this,’image3.gif’)” /></li> ... </ul></div>
  • 23. Cookie • Remove unnecessary cookie • Set expire date • Check domain level • Separate static / dynamic resource domain
  • 25. Initial Layout • Depend on HTML / CSS not JavaScript • quot;# $ %& '( • Window/Frame size • Not fully supported css property
  • 26. JavaScript Block Downloading • Move To Bottom
  • 28. FOUC & Blank White Screen • Why? • @import or <link> at bottom • Blank White Screen • New Window / Homepage • Move To Top
  • 29. FOUC & Blank White Screen
  • 30. AlphaImageLoader filter • Rendering Semi-transparent PNG24 • Problem • Block Loading & Rendering, Freeze Browser • link & mouse pointer • Solution • IE conditional comment & IE6 ‘_’ hack • a { position:relative; cursor:pointer; }
  • 32. PNG24
  • 33. AlphaImageLoader filter IE conditional comment style.css .png {background:transparent url(img.png) 0 0 no-repeat;} page.html <!--[if lte IE 6]> <style type=”text/css”> .png { background-image:none; filter:progid: DXImageTransform.Microsoft.AlphaImageLoader( src='img.png',sizingMethod='scale'); } </style> <![endif]-->
  • 34. Efficient CSS selector • Avoid universal rule • Don't qualify ID-categorized rules with tag names or classes • Avoid the descendant selector • Rely on inheritance
  • 36. CSS expression font-size: expression(document.body.clientWidth/10+‘px’); • IE proprietary • Continuously run when mousemove, keypress, resize, scroll event • Solution / Alternate • One-time expression • Event Handling
  • 37. Background Flickering • :hover (mouse over) action • IE6 • Flickering • Re-Request • http://fivesevensix.com/studies/ie6flicker/
  • 39. Background flickering Solution • JavaScript document.execCommand(quot;BackgroundImageCachequot;, false, true); • CSS html { filter:expression(document.execCommand( quot;BackgroundImageCachequot;, false, true)); } • Web Server - Apache BrowserMatch quot;MSIEquot; brokenvary=1 BrowserMatch quot;Mozilla/4.[0-9]{2}quot; brokenvary=1 BrowserMatch quot;Operaquot; !brokenvary SetEnvIf brokenvary 1 force-no-vary
  • 40. String Handling • Concatenation • + operator ! array.join() • Search • regexp ! string.indexOf() • Regular Expression • new RegExp() ! / ~ / literal
  • 41. DOM Access • Minimize DOM access • Offline access • Reuse reference
  • 42. 50x50 table creation W3C DOM Table methods innerHTML by Windows XP, Quirksmode.org IE6 IE7 Firefox2 Firefox3 Opera Safari 0 1,000 2,000 3,000 4,000 ms DOM I/O test
  • 43. Set Style • by style property - BAD elm.style.backgroundColor = ‘#f00’; elm.style.width = ‘20px’; • by CSS & className property - GOOD style.css .foo { background-color:#f00; width:20px; } script.js elm.className = ‘foo’;
  • 44. 4x425(1,700) td style className style by Windows XP, Quirksmode.org IE6 IE7 Firefox2 Firefox3 Opera Safari 0 100 200 300 400 ms Set Style test
  • 45. JavaScript Framework • prototype, jQuery,YUI ... • Performance issue • File size • Internal object inheritance • $() vs. document.getElementById()
  • 46. the Others • Cache • CDN(Contents Delivery Network) • Domain name • DNS lookup • Parallel download • ETags • Redirect
  • 47. Tools • Firebug • IBM page detailer • YSlow • Fiddler
  • 49. • Front-end Performance • Trade-off • Service / Client environment • As UI Developer • Unobtrusive JavaScript • Development Process • Accessibility
  • 50. References • YDN Exceptional Performance : Best Practices for Speeding Up Your Web Site • ) *+, -./ 01(High Performance Web Sites), 2'3, Steve Souders • QuirksMode.org
  • 51. Q/A
  • 52. Thank you suguni@gmail.com http://yuiworld.kr/suguni