SlideShare a Scribd company logo
1 of 21
Performance optimization
ID meeting
13 th January 2010

Filip Mares
Agenda
•Why Optimise Front-End?
•Importance of performance
•34 best practices
•Optimize CSS for faster browser rendering
•Write efficient CSS
•Minify CSS
Why Optimise Front-End?
• More potential for improvement
• Typically require less time = lower costs
• It’s proven to work
Importance of performance
• Better user experience
• More traffic
+0.4s = 5-9% drop in full-page traffic (Yahoo!)
• More revenue
+1sec = 2.8% drop in revenue
• Reduced costs
HW costs, bandwidth costs
Make it right
before you make it fast
34 best practices (by YDN)
1. Make fewer HTTP Requests

18. Preload Components

2. Use a Content Delivery Network

19. Reduce the Number of DOM Elements

3. Add an Expires or a Cache-Control Header

20. Split Components Across Domains

4. Gzip Components

21. Minimize the Number of iframes

5. Put Style sheets at the Top

22. No 404s

6. Put Scripts at the Bottom

23. Reduce Cookie Size

7. Avoid CSS Expressions

24. Use Cookie-free Domains for Components

8. Make JavaScript and CSS External

25. Minimize DOM Access

9. Reduce DNS Lookups

26. Develop Smart Event Handlers

10. Minify JavaScript and CSS

27. Choose <link> over @import

11. Avoid Redirects

28. Avoid Filters

12. Remove Duplicate JS and CSS

29. Optimize Images

13. Configure ETags

30. Optimize CSS Sprites

14. Make Ajax Cacheable

31. Don’t Scale Images in HTML

15. Flush the Buffer Early

32. Make favicon.ico Small and Cacheable

16. Use GET for Ajax Requests

33. Keep Components under 25K

17. Post-load Components

34. Pack Components into a Multipart Document
23 best practices for IDs
1. Make fewer HTTP Requests

18. Preload Components

2. Use a Content Delivery Network

19. Reduce the Number of DOM Elements

3. Add an Expires or a Cache-Control Header

20. Split Components Across Domains

4. Gzip Components

21. Minimize the Number of iframes

5. Put Style sheets at the Top

22. No 404s

6. Put Scripts at the Bottom

23. Reduce Cookie Size

7. Avoid CSS Expressions

24. Use Cookie-free Domains for Components

8. Make JavaScript and CSS External

25. Minimize DOM Access

9. Reduce DNS Lookups

26. Develop Smart Event Handlers

10. Minify JavaScript and CSS

27. Choose <link> over @import

11. Avoid Redirects

28. Avoid Filters

12. Remove Duplicate JS and CSS

29. Optimize Images

13. Configure ETags

30. Optimize CSS Sprites

14. Make Ajax Cacheable

31. Don’t Scale Images in HTML

15. Flush the Buffer Early

32. Make favicon.ico Small and Cacheable

16. Use GET for Ajax Requests

33. Keep Components under 25K

17. Post-load Components

34. Pack Components into a Multipart Document
Optimize CSS
for faster browser rendering
Less HTTP requests
• Combine CSS files
No separate print CSS
• Inline images with data
background‐image: url("data:image/png;base64,iVBORw0KG...");
• Lazy-load stylesheets used by JavaScript
CSS files on demand
Less HTTP requests - drawback
•Bigger files or more combinations to cache
•Not as nice as atomic components
•Inline images does not work in IE up to IE7
•Hard to make even small changes
•Need of new filename when the „never expire“ policy is on
Other CSS optimization practices
•Put CSS in the document head
•Make CSS External
•Choose <link> over @import
•Avoid Filters
•Avoid CSS expressions
•Specify image dimensions
Write efficient CSS
Descendants and child
selectors can affect
performance, but don’t
worry about them so much
as to not use them.
Efficient CSS practices
•Group selectors with common declarations

•Use CSS shorthand

#nav {text-align: center}
#main{text-align: center}
#nav, #main{text-align: center}

#nav {margin:2em 1em 3em 1em; padding: 0em;
color:#ffcc00}
#nav {margin:2em 1em 3em; padding: 0; color:#fc0}

•Group declarations with common selectors

•Abbreviate long class and ID names

#nav {text-align: center}
#nav {color:#eee}
#nav {text-align: center; color:#eee}

•Combine common styles into shared classes
•Keep the cascade in mind
•Use inheritance to eliminate duplicate
declarations
•Remove unused CSS

•Make rules as specific as possible
•Avoid universal rules
•Remove redundant qualifiers
•Avoid descendant selectors, especially those
that specify redundant ancestors
•Avoid the :hover pseudo-selector for non-link
elements for IE clients
Inefficient rules
•Rules with descendant selectors
body *
ul li a
•Rules with child or adjacent selectors
body > *
ul > li > a
•Rules with overly qualified selectors
form#UserLogin
•Rules that apply the :hover pseudo-selector to non-link elements
h3:hover
Minify CSS
Tested tools
•Clean CSS
•CSS Optimiser
•Icey CSS Compressor
•YUI Compressor
•flumpCakes Optimiser
Tested tools - results
Tool Used

File Size

Lines

compression ratio:

None

12,875

227

Original

Clean CSS

11,735

940

9%

CSS Optimiser

11,304

2

12%

Icey CSS Compressor

10,383

1

19%

YUI Compressor

11,175

1

13%

796

0%

Flumpcakes Optimiser 12,885
Questions?
Thanks
for listening
Links
•Best Practices for Speeding Up Your Web Site
http://developer.yahoo.com/performance/rules.html

•Testing CSS Performance
http://blog.archive.jpsykes.com/151/testing-css-performance/

•Performance Impact of CSS Selectors
http://www.stevesouders.com/blog/2009/03/10/performance-impact-of-css-selectors/

•Optimize browser rendering
http://code.google.com/speed/page-speed/docs/rendering.html

•CSS Optimization: Make Your Sites Load Faster for Free
http://www.bloggingpro.com/archives/2006/08/17/css-optimization/

More Related Content

What's hot

Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)Bill Condo
 
The server side story: Parallel and Asynchronous programming in .NET - ITPro...
The server side story:  Parallel and Asynchronous programming in .NET - ITPro...The server side story:  Parallel and Asynchronous programming in .NET - ITPro...
The server side story: Parallel and Asynchronous programming in .NET - ITPro...Panagiotis Kanavos
 
Getting Started with Web Services
Getting Started with Web ServicesGetting Started with Web Services
Getting Started with Web ServicesDataNext Solutions
 
Silverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsSilverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsBrettTasker
 
Benchmarking NGINX for Accuracy and Results
Benchmarking NGINX for Accuracy and ResultsBenchmarking NGINX for Accuracy and Results
Benchmarking NGINX for Accuracy and ResultsNGINX, Inc.
 
ASP.NET Scalability - WebDD
ASP.NET Scalability - WebDDASP.NET Scalability - WebDD
ASP.NET Scalability - WebDDPhil Pursglove
 
Building a better web
Building a better webBuilding a better web
Building a better webFastly
 
Level Up: 5 Expert Tips for Optimizing WordPress Performance
Level Up: 5 Expert Tips for Optimizing WordPress PerformanceLevel Up: 5 Expert Tips for Optimizing WordPress Performance
Level Up: 5 Expert Tips for Optimizing WordPress PerformancePantheon
 
Why Wordnik went non-relational
Why Wordnik went non-relationalWhy Wordnik went non-relational
Why Wordnik went non-relationalTony Tam
 
ASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonPhil Pursglove
 
Supporting large scale React applications
Supporting large scale React applicationsSupporting large scale React applications
Supporting large scale React applicationsMaurice De Beijer [MVP]
 
Windows Azure Service Bus
Windows Azure Service BusWindows Azure Service Bus
Windows Azure Service BusPavel Revenkov
 
A Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-ServiceA Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-ServiceValeri Karpov
 
Building large scalable mission critical business applications on the web
Building large scalable mission critical business applications on the webBuilding large scalable mission critical business applications on the web
Building large scalable mission critical business applications on the webMaurice De Beijer [MVP]
 
Inside election night at The New York Times | Altitude NYC
Inside election night at The New York Times | Altitude NYCInside election night at The New York Times | Altitude NYC
Inside election night at The New York Times | Altitude NYCFastly
 
4th Lecture: JSP and such
4th Lecture:  JSP and such4th Lecture:  JSP and such
4th Lecture: JSP and suchManolis Vavalis
 
Keeping the Lights On with MongoDB
Keeping the Lights On with MongoDBKeeping the Lights On with MongoDB
Keeping the Lights On with MongoDBTony Tam
 
Living on the Edge: Elevating your SEO toolkit to the CDN
Living on the Edge: Elevating your SEO toolkit to the CDNLiving on the Edge: Elevating your SEO toolkit to the CDN
Living on the Edge: Elevating your SEO toolkit to the CDNNils De Moor
 
Caching your rails application
Caching your rails applicationCaching your rails application
Caching your rails applicationArrrrCamp
 

What's hot (20)

Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
 
The server side story: Parallel and Asynchronous programming in .NET - ITPro...
The server side story:  Parallel and Asynchronous programming in .NET - ITPro...The server side story:  Parallel and Asynchronous programming in .NET - ITPro...
The server side story: Parallel and Asynchronous programming in .NET - ITPro...
 
Getting Started with Web Services
Getting Started with Web ServicesGetting Started with Web Services
Getting Started with Web Services
 
Silverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsSilverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applications
 
Benchmarking NGINX for Accuracy and Results
Benchmarking NGINX for Accuracy and ResultsBenchmarking NGINX for Accuracy and Results
Benchmarking NGINX for Accuracy and Results
 
Node js
Node jsNode js
Node js
 
ASP.NET Scalability - WebDD
ASP.NET Scalability - WebDDASP.NET Scalability - WebDD
ASP.NET Scalability - WebDD
 
Building a better web
Building a better webBuilding a better web
Building a better web
 
Level Up: 5 Expert Tips for Optimizing WordPress Performance
Level Up: 5 Expert Tips for Optimizing WordPress PerformanceLevel Up: 5 Expert Tips for Optimizing WordPress Performance
Level Up: 5 Expert Tips for Optimizing WordPress Performance
 
Why Wordnik went non-relational
Why Wordnik went non-relationalWhy Wordnik went non-relational
Why Wordnik went non-relational
 
ASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG LondonASP.NET Scalability - VBUG London
ASP.NET Scalability - VBUG London
 
Supporting large scale React applications
Supporting large scale React applicationsSupporting large scale React applications
Supporting large scale React applications
 
Windows Azure Service Bus
Windows Azure Service BusWindows Azure Service Bus
Windows Azure Service Bus
 
A Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-ServiceA Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-Service
 
Building large scalable mission critical business applications on the web
Building large scalable mission critical business applications on the webBuilding large scalable mission critical business applications on the web
Building large scalable mission critical business applications on the web
 
Inside election night at The New York Times | Altitude NYC
Inside election night at The New York Times | Altitude NYCInside election night at The New York Times | Altitude NYC
Inside election night at The New York Times | Altitude NYC
 
4th Lecture: JSP and such
4th Lecture:  JSP and such4th Lecture:  JSP and such
4th Lecture: JSP and such
 
Keeping the Lights On with MongoDB
Keeping the Lights On with MongoDBKeeping the Lights On with MongoDB
Keeping the Lights On with MongoDB
 
Living on the Edge: Elevating your SEO toolkit to the CDN
Living on the Edge: Elevating your SEO toolkit to the CDNLiving on the Edge: Elevating your SEO toolkit to the CDN
Living on the Edge: Elevating your SEO toolkit to the CDN
 
Caching your rails application
Caching your rails applicationCaching your rails application
Caching your rails application
 

Viewers also liked

Anatomie mobilního webu
Anatomie mobilního webuAnatomie mobilního webu
Anatomie mobilního webuFilip Mares
 
Let’s practice critical thinking
Let’s practice critical thinkingLet’s practice critical thinking
Let’s practice critical thinkingcoop8
 
Komponenty v kaskákdě
Komponenty v kaskákděKomponenty v kaskákdě
Komponenty v kaskákděFilip Mares
 
HTML5 Geolocation API
HTML5 Geolocation APIHTML5 Geolocation API
HTML5 Geolocation APIFilip Mares
 

Viewers also liked (6)

Anatomie mobilního webu
Anatomie mobilního webuAnatomie mobilního webu
Anatomie mobilního webu
 
Let’s practice critical thinking
Let’s practice critical thinkingLet’s practice critical thinking
Let’s practice critical thinking
 
Proofread symbols
Proofread symbolsProofread symbols
Proofread symbols
 
Komponenty v kaskákdě
Komponenty v kaskákděKomponenty v kaskákdě
Komponenty v kaskákdě
 
HTML5 Geolocation API
HTML5 Geolocation APIHTML5 Geolocation API
HTML5 Geolocation API
 
77094122 report-on-aarong-part-two
77094122 report-on-aarong-part-two77094122 report-on-aarong-part-two
77094122 report-on-aarong-part-two
 

Similar to Performance optimization - Basics

High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax ApplicationsSiarhei Barysiuk
 
Web performance optimization for modern web applications
Web performance optimization for modern web applicationsWeb performance optimization for modern web applications
Web performance optimization for modern web applicationsChris Love
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pagesNilesh Bafna
 
Frontend performance
Frontend performanceFrontend performance
Frontend performancesacred 8
 
10 things you can do to speed up your web app today stir trek edition
10 things you can do to speed up your web app today   stir trek edition10 things you can do to speed up your web app today   stir trek edition
10 things you can do to speed up your web app today stir trek editionChris Love
 
Performace optimization (increase website speed)
Performace optimization (increase website speed)Performace optimization (increase website speed)
Performace optimization (increase website speed)clickramanm
 
High performance website
High performance websiteHigh performance website
High performance websiteChamnap Chhorn
 
10 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 201610 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 2016Chris Love
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tipsChris Love
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Deepak Sharma
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSZoe Gillenwater
 
10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App TodayChris Love
 
Advanced CSS Troubleshooting & Efficiency
Advanced CSS Troubleshooting & EfficiencyAdvanced CSS Troubleshooting & Efficiency
Advanced CSS Troubleshooting & EfficiencyDenise Jacobs
 
Building Faster Websites
Building Faster WebsitesBuilding Faster Websites
Building Faster WebsitesCraig Walker
 
Drupal front-end performance
Drupal front-end performance Drupal front-end performance
Drupal front-end performance ADCI Solutions
 
Advanced CSS Troubleshooting
Advanced CSS TroubleshootingAdvanced CSS Troubleshooting
Advanced CSS TroubleshootingDenise Jacobs
 
Website Performance
Website PerformanceWebsite Performance
Website PerformanceHugo Fonseca
 

Similar to Performance optimization - Basics (20)

High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
Web performance optimization for modern web applications
Web performance optimization for modern web applicationsWeb performance optimization for modern web applications
Web performance optimization for modern web applications
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pages
 
Frontend performance
Frontend performanceFrontend performance
Frontend performance
 
10 things you can do to speed up your web app today stir trek edition
10 things you can do to speed up your web app today   stir trek edition10 things you can do to speed up your web app today   stir trek edition
10 things you can do to speed up your web app today stir trek edition
 
Performace optimization (increase website speed)
Performace optimization (increase website speed)Performace optimization (increase website speed)
Performace optimization (increase website speed)
 
High performance website
High performance websiteHigh performance website
High performance website
 
10 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 201610 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 2016
 
Speed!
Speed!Speed!
Speed!
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tips
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSS
 
10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today
 
Advanced CSS Troubleshooting & Efficiency
Advanced CSS Troubleshooting & EfficiencyAdvanced CSS Troubleshooting & Efficiency
Advanced CSS Troubleshooting & Efficiency
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
 
Building Faster Websites
Building Faster WebsitesBuilding Faster Websites
Building Faster Websites
 
Drupal front-end performance
Drupal front-end performance Drupal front-end performance
Drupal front-end performance
 
Advanced CSS Troubleshooting
Advanced CSS TroubleshootingAdvanced CSS Troubleshooting
Advanced CSS Troubleshooting
 
Performance tuning of Websites
Performance tuning of WebsitesPerformance tuning of Websites
Performance tuning of Websites
 
Website Performance
Website PerformanceWebsite Performance
Website Performance
 

Recently uploaded

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Recently uploaded (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

Performance optimization - Basics

  • 1. Performance optimization ID meeting 13 th January 2010 Filip Mares
  • 2. Agenda •Why Optimise Front-End? •Importance of performance •34 best practices •Optimize CSS for faster browser rendering •Write efficient CSS •Minify CSS
  • 3. Why Optimise Front-End? • More potential for improvement • Typically require less time = lower costs • It’s proven to work
  • 4. Importance of performance • Better user experience • More traffic +0.4s = 5-9% drop in full-page traffic (Yahoo!) • More revenue +1sec = 2.8% drop in revenue • Reduced costs HW costs, bandwidth costs
  • 5. Make it right before you make it fast
  • 6. 34 best practices (by YDN) 1. Make fewer HTTP Requests 18. Preload Components 2. Use a Content Delivery Network 19. Reduce the Number of DOM Elements 3. Add an Expires or a Cache-Control Header 20. Split Components Across Domains 4. Gzip Components 21. Minimize the Number of iframes 5. Put Style sheets at the Top 22. No 404s 6. Put Scripts at the Bottom 23. Reduce Cookie Size 7. Avoid CSS Expressions 24. Use Cookie-free Domains for Components 8. Make JavaScript and CSS External 25. Minimize DOM Access 9. Reduce DNS Lookups 26. Develop Smart Event Handlers 10. Minify JavaScript and CSS 27. Choose <link> over @import 11. Avoid Redirects 28. Avoid Filters 12. Remove Duplicate JS and CSS 29. Optimize Images 13. Configure ETags 30. Optimize CSS Sprites 14. Make Ajax Cacheable 31. Don’t Scale Images in HTML 15. Flush the Buffer Early 32. Make favicon.ico Small and Cacheable 16. Use GET for Ajax Requests 33. Keep Components under 25K 17. Post-load Components 34. Pack Components into a Multipart Document
  • 7. 23 best practices for IDs 1. Make fewer HTTP Requests 18. Preload Components 2. Use a Content Delivery Network 19. Reduce the Number of DOM Elements 3. Add an Expires or a Cache-Control Header 20. Split Components Across Domains 4. Gzip Components 21. Minimize the Number of iframes 5. Put Style sheets at the Top 22. No 404s 6. Put Scripts at the Bottom 23. Reduce Cookie Size 7. Avoid CSS Expressions 24. Use Cookie-free Domains for Components 8. Make JavaScript and CSS External 25. Minimize DOM Access 9. Reduce DNS Lookups 26. Develop Smart Event Handlers 10. Minify JavaScript and CSS 27. Choose <link> over @import 11. Avoid Redirects 28. Avoid Filters 12. Remove Duplicate JS and CSS 29. Optimize Images 13. Configure ETags 30. Optimize CSS Sprites 14. Make Ajax Cacheable 31. Don’t Scale Images in HTML 15. Flush the Buffer Early 32. Make favicon.ico Small and Cacheable 16. Use GET for Ajax Requests 33. Keep Components under 25K 17. Post-load Components 34. Pack Components into a Multipart Document
  • 8. Optimize CSS for faster browser rendering
  • 9. Less HTTP requests • Combine CSS files No separate print CSS • Inline images with data background‐image: url("data:image/png;base64,iVBORw0KG..."); • Lazy-load stylesheets used by JavaScript CSS files on demand
  • 10. Less HTTP requests - drawback •Bigger files or more combinations to cache •Not as nice as atomic components •Inline images does not work in IE up to IE7 •Hard to make even small changes •Need of new filename when the „never expire“ policy is on
  • 11. Other CSS optimization practices •Put CSS in the document head •Make CSS External •Choose <link> over @import •Avoid Filters •Avoid CSS expressions •Specify image dimensions
  • 13. Descendants and child selectors can affect performance, but don’t worry about them so much as to not use them.
  • 14. Efficient CSS practices •Group selectors with common declarations •Use CSS shorthand #nav {text-align: center} #main{text-align: center} #nav, #main{text-align: center} #nav {margin:2em 1em 3em 1em; padding: 0em; color:#ffcc00} #nav {margin:2em 1em 3em; padding: 0; color:#fc0} •Group declarations with common selectors •Abbreviate long class and ID names #nav {text-align: center} #nav {color:#eee} #nav {text-align: center; color:#eee} •Combine common styles into shared classes •Keep the cascade in mind •Use inheritance to eliminate duplicate declarations •Remove unused CSS •Make rules as specific as possible •Avoid universal rules •Remove redundant qualifiers •Avoid descendant selectors, especially those that specify redundant ancestors •Avoid the :hover pseudo-selector for non-link elements for IE clients
  • 15. Inefficient rules •Rules with descendant selectors body * ul li a •Rules with child or adjacent selectors body > * ul > li > a •Rules with overly qualified selectors form#UserLogin •Rules that apply the :hover pseudo-selector to non-link elements h3:hover
  • 17. Tested tools •Clean CSS •CSS Optimiser •Icey CSS Compressor •YUI Compressor •flumpCakes Optimiser
  • 18. Tested tools - results Tool Used File Size Lines compression ratio: None 12,875 227 Original Clean CSS 11,735 940 9% CSS Optimiser 11,304 2 12% Icey CSS Compressor 10,383 1 19% YUI Compressor 11,175 1 13% 796 0% Flumpcakes Optimiser 12,885
  • 21. Links •Best Practices for Speeding Up Your Web Site http://developer.yahoo.com/performance/rules.html •Testing CSS Performance http://blog.archive.jpsykes.com/151/testing-css-performance/ •Performance Impact of CSS Selectors http://www.stevesouders.com/blog/2009/03/10/performance-impact-of-css-selectors/ •Optimize browser rendering http://code.google.com/speed/page-speed/docs/rendering.html •CSS Optimization: Make Your Sites Load Faster for Free http://www.bloggingpro.com/archives/2006/08/17/css-optimization/