SlideShare a Scribd company logo
1 of 18
Automating 
Performance Optimization 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
For the Client Side!
A pertinent question? 
Why is this giant bearded man talking to me about this 
topic? 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 2 
… Favorite tag: <canvas>
Agenda 
• Definitions 
• Background 
• Automating Performance Optimization 
– Methodology 
– Tools 
– JavaScript 
– CSS 
– Images 
– Some Manual (Code Review) Items 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
• Q & A 
• Appendices 
Page 3
Disclaimers and Caveats (Oh My) 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 4 
• Disclaimers 
– Disclaimer #1: Great performance still requires great code! 
– Disclaimer #2: Not just an asset pipeline! 
– Disclaimer #3: Of course you can’t automate all 
performance optimization… but you can automate some 
important things. 
• Caveat 
– Most premature optimization is bad! However, some can be 
good (seriously)
What is automated client performance 
optimization? 
• Answer: Reducing file size, http downloads, render 
time, improving code performance.. (dramatic music) 
automatically 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 5 
• Scope: performance-related tuning we can do by 
setting up automatic tasks in build/optimize tasks
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Why? 
Page 6 
Build (and optimize) running! 
But seriously, we can get a 
lot of value for comparatively 
little effort.
Methodology: Define 
• Think through everything you need to work through 
or that could slow your application down: 
– Lots of unused CSS rules (bootstrap, jqueryUI etc are big 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 7 
culprits here) 
– Not-so-responsive images on a responsive site 
– Multiple media query definitions 
– Un-optimized images 
– Other (we’ll get to those)
Methodology: Solve 
• Use a task automation tool to automate as much as 
possible (humans make mistakes!) 
• What can’t be done with the automation tool, include 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 8 
as part of a development process where humans 
intervene at the right places
Tools of the trade 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 9 
or
Copyright © 2014 Accenture LLP. All Rights Reserved. 
JavaScript 
Page 10 
• Use automated code quality tools, 
embedded in a grunt analyze or 
gulp analyze task 
• Embed these tools into your build / CI 
process 
• Require.js! 
• Peer review constantly, ideally with a 
tool like Phabricator, embedded into 
your dev process
CSS Preamble 
• CSS Preamble: All of this requires some pre-planning 
and structure 
– If you’re using a modular project structure, your grunt/gulp 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 11 
file will probably get a bit complex 
– Try to separate your css into logical groupings, e.g. vendor, 
common, page-specific 
• Follow a specific task order: CSS preprocessor  
Optimization Tasks  Minify & Concatenate CSS
• Inline CSS: Automatically inline uncommonly used 
CSS rules 
– Make sure those rules are in files with other uncommonly 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
CSS 
Page 12 
used rules 
• Defcon 5: Remove unused CSS with unCSS 
– Note: if you’re not careful, this will remove all the css 
applied by JS/pseudoclasses 
– Make liberal use of the ignore file 
– Include dynamically applied CSS in its own files, so you 
can ignore it
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Images 
Page 13 
• Optimize them! 
– Images run through most modern 
optimization/compression algorithms (e.g. optipng, jpgtran) 
are virtually indistinguishable from source images. 
• Not even creatives can tell the difference, honest! 
• Make responsive images automatically 
– Set sizes according to breakpoints, etc 
– Combine with Imager.js to make real magic 
• Sprites 
– For appropriate icons, create sprites or… 
– Create a Webfont from svg icons!
Code Review Items 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 14 
• Local Storage 
• HTML5 Application Cache 
• Batch API calls when possible: 
– Create an API object, e.g. 
• api.add(…) 
• api.add(…) 
• api.send(…) 
• Use 3D Animations (yay hardware acceleration) 
• Promises are your friends
Caveat to everything above… 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 15 
(old versions, 
of course)
Questions? 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 16
Appendix: Tasks 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 17 
• JavaScript 
– grunt-contrib-jshint 
– gulp-jshint 
– grunt-eslint 
– gulp-eslint 
• CSS 
– grunt-contrib-cssmin 
– gulp-cssmin 
– grunt-inline-css 
– grunt-uncss 
• Images 
– grunt-contrib-imagemin 
– gulp-imagemin 
– grunt-responsive-images 
– Imager.js 
– grunt-spritesmith 
– grunt-webfont
Appendix 2: Credits 
• Authors of all the awesome libraries and tasks used! 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 18

More Related Content

What's hot

jQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web PerformancejQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web Performancedmethvin
 
jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013dmethvin
 
jQuery Chicago 2014 - Next-generation JavaScript Testing
jQuery Chicago 2014 - Next-generation JavaScript TestingjQuery Chicago 2014 - Next-generation JavaScript Testing
jQuery Chicago 2014 - Next-generation JavaScript TestingVlad Filippov
 
jQuery Mobile Overview - Boston
jQuery Mobile  Overview -  BostonjQuery Mobile  Overview -  Boston
jQuery Mobile Overview - BostonTodd Parker
 
jQuery Foundation Keynote
jQuery Foundation KeynotejQuery Foundation Keynote
jQuery Foundation KeynoteRichard Worth
 
JavaScript MV* Framework - Making the Right Choice
JavaScript MV* Framework - Making the Right ChoiceJavaScript MV* Framework - Making the Right Choice
JavaScript MV* Framework - Making the Right ChoiceDmitry Sheiko
 
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?MarkupBox
 
SlickGrid Touch: Making complex JavaScript widgets work on mobile devices
SlickGrid Touch: Making complex JavaScript widgets work on mobile devicesSlickGrid Touch: Making complex JavaScript widgets work on mobile devices
SlickGrid Touch: Making complex JavaScript widgets work on mobile devicesreebalazs
 
Wulin kungfu final
Wulin kungfu finalWulin kungfu final
Wulin kungfu finalJimmy Huang
 
Angular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFxAngular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFxDimcho Tsanov
 
AngularJS + React
AngularJS + ReactAngularJS + React
AngularJS + Reactjustvamp
 
Atomic Design with Next.js
Atomic Design with Next.jsAtomic Design with Next.js
Atomic Design with Next.jsPatrick Smith
 
New Perspectives on Performance
New Perspectives on PerformanceNew Perspectives on Performance
New Perspectives on Performancemennovanslooten
 
Mvvm knockout vs angular
Mvvm knockout vs angularMvvm knockout vs angular
Mvvm knockout vs angularBasarat Syed
 
JS Framework Comparison - An infographic
JS Framework Comparison - An infographicJS Framework Comparison - An infographic
JS Framework Comparison - An infographicInApp
 
Introduction to SPA with AngularJS
Introduction to SPA with AngularJSIntroduction to SPA with AngularJS
Introduction to SPA with AngularJSRiki Pribadi
 
Flexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework WorldFlexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework WorldKevin Ball
 
Angular.js Talk at the November Meetup of the BerlinJS User Group
Angular.js Talk at the November Meetup of the BerlinJS User GroupAngular.js Talk at the November Meetup of the BerlinJS User Group
Angular.js Talk at the November Meetup of the BerlinJS User GroupManuel Kießling
 

What's hot (20)

jQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web PerformancejQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web Performance
 
jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013
 
jQuery Chicago 2014 - Next-generation JavaScript Testing
jQuery Chicago 2014 - Next-generation JavaScript TestingjQuery Chicago 2014 - Next-generation JavaScript Testing
jQuery Chicago 2014 - Next-generation JavaScript Testing
 
jQuery Mobile Overview - Boston
jQuery Mobile  Overview -  BostonjQuery Mobile  Overview -  Boston
jQuery Mobile Overview - Boston
 
jQuery Foundation Keynote
jQuery Foundation KeynotejQuery Foundation Keynote
jQuery Foundation Keynote
 
JavaScript MV* Framework - Making the Right Choice
JavaScript MV* Framework - Making the Right ChoiceJavaScript MV* Framework - Making the Right Choice
JavaScript MV* Framework - Making the Right Choice
 
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
 
SlickGrid Touch: Making complex JavaScript widgets work on mobile devices
SlickGrid Touch: Making complex JavaScript widgets work on mobile devicesSlickGrid Touch: Making complex JavaScript widgets work on mobile devices
SlickGrid Touch: Making complex JavaScript widgets work on mobile devices
 
Wulin kungfu final
Wulin kungfu finalWulin kungfu final
Wulin kungfu final
 
Angular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFxAngular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFx
 
AngularJS + React
AngularJS + ReactAngularJS + React
AngularJS + React
 
Atomic Design with Next.js
Atomic Design with Next.jsAtomic Design with Next.js
Atomic Design with Next.js
 
New Perspectives on Performance
New Perspectives on PerformanceNew Perspectives on Performance
New Perspectives on Performance
 
Mvvm knockout vs angular
Mvvm knockout vs angularMvvm knockout vs angular
Mvvm knockout vs angular
 
JS Framework Comparison - An infographic
JS Framework Comparison - An infographicJS Framework Comparison - An infographic
JS Framework Comparison - An infographic
 
A team 43 C
A team 43 CA team 43 C
A team 43 C
 
Spa with angular
Spa with angularSpa with angular
Spa with angular
 
Introduction to SPA with AngularJS
Introduction to SPA with AngularJSIntroduction to SPA with AngularJS
Introduction to SPA with AngularJS
 
Flexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework WorldFlexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework World
 
Angular.js Talk at the November Meetup of the BerlinJS User Group
Angular.js Talk at the November Meetup of the BerlinJS User GroupAngular.js Talk at the November Meetup of the BerlinJS User Group
Angular.js Talk at the November Meetup of the BerlinJS User Group
 

Similar to Automated perf optimization - jQuery Conference

Automated perf optimization - html5 dev conf
Automated perf optimization - html5 dev confAutomated perf optimization - html5 dev conf
Automated perf optimization - html5 dev confMatthew Lancaster
 
Minimize website page loading time – 20+ advanced SEO tips
Minimize website page loading time – 20+ advanced SEO tipsMinimize website page loading time – 20+ advanced SEO tips
Minimize website page loading time – 20+ advanced SEO tipsCgColors
 
Pearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET DeveloperPearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET DeveloperOfer Zelig
 
Rails Asset Pipeline - What, Why, Tips, Do's and Dont's
Rails Asset Pipeline - What, Why, Tips, Do's and Dont'sRails Asset Pipeline - What, Why, Tips, Do's and Dont's
Rails Asset Pipeline - What, Why, Tips, Do's and Dont'sRohan Daxini
 
WebHosting Performance / WordPress - Pubcon Vegas - Hendison
WebHosting Performance / WordPress  - Pubcon Vegas - HendisonWebHosting Performance / WordPress  - Pubcon Vegas - Hendison
WebHosting Performance / WordPress - Pubcon Vegas - HendisonSearch Commander, Inc.
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeededm00se
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your WebsiteAcquia
 
Measuring Web Performance - HighEdWeb Edition
Measuring Web Performance - HighEdWeb EditionMeasuring Web Performance - HighEdWeb Edition
Measuring Web Performance - HighEdWeb EditionDave Olsen
 
The Superhero’s Method of Modern HTML5 Development by RapidValue Solutions
The Superhero’s Method of Modern HTML5 Development by RapidValue SolutionsThe Superhero’s Method of Modern HTML5 Development by RapidValue Solutions
The Superhero’s Method of Modern HTML5 Development by RapidValue SolutionsRapidValue
 
Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11Jess Coburn
 
Office 365 Intranet
Office 365 IntranetOffice 365 Intranet
Office 365 IntranetAlan Eardley
 
Tips tricks deliver_high_performing_secure_web_pages
Tips tricks deliver_high_performing_secure_web_pagesTips tricks deliver_high_performing_secure_web_pages
Tips tricks deliver_high_performing_secure_web_pagesAditya Singh
 
Sahi Principles and Architecture
Sahi Principles and ArchitectureSahi Principles and Architecture
Sahi Principles and ArchitectureTyto Software
 
Developer Night - Opticon18
Developer Night - Opticon18Developer Night - Opticon18
Developer Night - Opticon18Optimizely
 
Famo.us - build native quality apps using html5 within a day
Famo.us - build native quality apps using html5 within a dayFamo.us - build native quality apps using html5 within a day
Famo.us - build native quality apps using html5 within a dayDebnath Sinha
 
Opticon18: Developer Night
Opticon18: Developer NightOpticon18: Developer Night
Opticon18: Developer NightOptimizely
 
Stc 2015 preparing legacy projects for responsive design - technical issues
Stc 2015   preparing legacy projects for responsive design - technical issuesStc 2015   preparing legacy projects for responsive design - technical issues
Stc 2015 preparing legacy projects for responsive design - technical issuesNeil Perlin
 
Benchmarking Web Application Scanners for YOUR Organization
Benchmarking Web Application Scanners for YOUR OrganizationBenchmarking Web Application Scanners for YOUR Organization
Benchmarking Web Application Scanners for YOUR OrganizationDenim Group
 

Similar to Automated perf optimization - jQuery Conference (20)

Automated perf optimization - html5 dev conf
Automated perf optimization - html5 dev confAutomated perf optimization - html5 dev conf
Automated perf optimization - html5 dev conf
 
Minimize website page loading time – 20+ advanced SEO tips
Minimize website page loading time – 20+ advanced SEO tipsMinimize website page loading time – 20+ advanced SEO tips
Minimize website page loading time – 20+ advanced SEO tips
 
Pearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET DeveloperPearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET Developer
 
Rails Asset Pipeline - What, Why, Tips, Do's and Dont's
Rails Asset Pipeline - What, Why, Tips, Do's and Dont'sRails Asset Pipeline - What, Why, Tips, Do's and Dont's
Rails Asset Pipeline - What, Why, Tips, Do's and Dont's
 
WebHosting Performance / WordPress - Pubcon Vegas - Hendison
WebHosting Performance / WordPress  - Pubcon Vegas - HendisonWebHosting Performance / WordPress  - Pubcon Vegas - Hendison
WebHosting Performance / WordPress - Pubcon Vegas - Hendison
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website
 
Measuring Web Performance - HighEdWeb Edition
Measuring Web Performance - HighEdWeb EditionMeasuring Web Performance - HighEdWeb Edition
Measuring Web Performance - HighEdWeb Edition
 
The Superhero’s Method of Modern HTML5 Development by RapidValue Solutions
The Superhero’s Method of Modern HTML5 Development by RapidValue SolutionsThe Superhero’s Method of Modern HTML5 Development by RapidValue Solutions
The Superhero’s Method of Modern HTML5 Development by RapidValue Solutions
 
Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11
 
Office 365 Intranet
Office 365 IntranetOffice 365 Intranet
Office 365 Intranet
 
Tips tricks deliver_high_performing_secure_web_pages
Tips tricks deliver_high_performing_secure_web_pagesTips tricks deliver_high_performing_secure_web_pages
Tips tricks deliver_high_performing_secure_web_pages
 
Sahi Principles and Architecture
Sahi Principles and ArchitectureSahi Principles and Architecture
Sahi Principles and Architecture
 
Developer Night - Opticon18
Developer Night - Opticon18Developer Night - Opticon18
Developer Night - Opticon18
 
Sencha Services
Sencha ServicesSencha Services
Sencha Services
 
Famo.us - build native quality apps using html5 within a day
Famo.us - build native quality apps using html5 within a dayFamo.us - build native quality apps using html5 within a day
Famo.us - build native quality apps using html5 within a day
 
Opticon18: Developer Night
Opticon18: Developer NightOpticon18: Developer Night
Opticon18: Developer Night
 
Stc 2015 preparing legacy projects for responsive design - technical issues
Stc 2015   preparing legacy projects for responsive design - technical issuesStc 2015   preparing legacy projects for responsive design - technical issues
Stc 2015 preparing legacy projects for responsive design - technical issues
 
Benchmarking Web Application Scanners for YOUR Organization
Benchmarking Web Application Scanners for YOUR OrganizationBenchmarking Web Application Scanners for YOUR Organization
Benchmarking Web Application Scanners for YOUR Organization
 

Recently uploaded

Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
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
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
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
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
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
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
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
 

Recently uploaded (20)

Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
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
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
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
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
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
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
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
 

Automated perf optimization - jQuery Conference

  • 1. Automating Performance Optimization Copyright © 2014 Accenture LLP. All Rights Reserved. For the Client Side!
  • 2. A pertinent question? Why is this giant bearded man talking to me about this topic? Copyright © 2014 Accenture LLP. All Rights Reserved. Page 2 … Favorite tag: <canvas>
  • 3. Agenda • Definitions • Background • Automating Performance Optimization – Methodology – Tools – JavaScript – CSS – Images – Some Manual (Code Review) Items Copyright © 2014 Accenture LLP. All Rights Reserved. • Q & A • Appendices Page 3
  • 4. Disclaimers and Caveats (Oh My) Copyright © 2014 Accenture LLP. All Rights Reserved. Page 4 • Disclaimers – Disclaimer #1: Great performance still requires great code! – Disclaimer #2: Not just an asset pipeline! – Disclaimer #3: Of course you can’t automate all performance optimization… but you can automate some important things. • Caveat – Most premature optimization is bad! However, some can be good (seriously)
  • 5. What is automated client performance optimization? • Answer: Reducing file size, http downloads, render time, improving code performance.. (dramatic music) automatically Copyright © 2014 Accenture LLP. All Rights Reserved. Page 5 • Scope: performance-related tuning we can do by setting up automatic tasks in build/optimize tasks
  • 6. Copyright © 2014 Accenture LLP. All Rights Reserved. Why? Page 6 Build (and optimize) running! But seriously, we can get a lot of value for comparatively little effort.
  • 7. Methodology: Define • Think through everything you need to work through or that could slow your application down: – Lots of unused CSS rules (bootstrap, jqueryUI etc are big Copyright © 2014 Accenture LLP. All Rights Reserved. Page 7 culprits here) – Not-so-responsive images on a responsive site – Multiple media query definitions – Un-optimized images – Other (we’ll get to those)
  • 8. Methodology: Solve • Use a task automation tool to automate as much as possible (humans make mistakes!) • What can’t be done with the automation tool, include Copyright © 2014 Accenture LLP. All Rights Reserved. Page 8 as part of a development process where humans intervene at the right places
  • 9. Tools of the trade Copyright © 2014 Accenture LLP. All Rights Reserved. Page 9 or
  • 10. Copyright © 2014 Accenture LLP. All Rights Reserved. JavaScript Page 10 • Use automated code quality tools, embedded in a grunt analyze or gulp analyze task • Embed these tools into your build / CI process • Require.js! • Peer review constantly, ideally with a tool like Phabricator, embedded into your dev process
  • 11. CSS Preamble • CSS Preamble: All of this requires some pre-planning and structure – If you’re using a modular project structure, your grunt/gulp Copyright © 2014 Accenture LLP. All Rights Reserved. Page 11 file will probably get a bit complex – Try to separate your css into logical groupings, e.g. vendor, common, page-specific • Follow a specific task order: CSS preprocessor  Optimization Tasks  Minify & Concatenate CSS
  • 12. • Inline CSS: Automatically inline uncommonly used CSS rules – Make sure those rules are in files with other uncommonly Copyright © 2014 Accenture LLP. All Rights Reserved. CSS Page 12 used rules • Defcon 5: Remove unused CSS with unCSS – Note: if you’re not careful, this will remove all the css applied by JS/pseudoclasses – Make liberal use of the ignore file – Include dynamically applied CSS in its own files, so you can ignore it
  • 13. Copyright © 2014 Accenture LLP. All Rights Reserved. Images Page 13 • Optimize them! – Images run through most modern optimization/compression algorithms (e.g. optipng, jpgtran) are virtually indistinguishable from source images. • Not even creatives can tell the difference, honest! • Make responsive images automatically – Set sizes according to breakpoints, etc – Combine with Imager.js to make real magic • Sprites – For appropriate icons, create sprites or… – Create a Webfont from svg icons!
  • 14. Code Review Items Copyright © 2014 Accenture LLP. All Rights Reserved. Page 14 • Local Storage • HTML5 Application Cache • Batch API calls when possible: – Create an API object, e.g. • api.add(…) • api.add(…) • api.send(…) • Use 3D Animations (yay hardware acceleration) • Promises are your friends
  • 15. Caveat to everything above… Copyright © 2014 Accenture LLP. All Rights Reserved. Page 15 (old versions, of course)
  • 16. Questions? Copyright © 2014 Accenture LLP. All Rights Reserved. Page 16
  • 17. Appendix: Tasks Copyright © 2014 Accenture LLP. All Rights Reserved. Page 17 • JavaScript – grunt-contrib-jshint – gulp-jshint – grunt-eslint – gulp-eslint • CSS – grunt-contrib-cssmin – gulp-cssmin – grunt-inline-css – grunt-uncss • Images – grunt-contrib-imagemin – gulp-imagemin – grunt-responsive-images – Imager.js – grunt-spritesmith – grunt-webfont
  • 18. Appendix 2: Credits • Authors of all the awesome libraries and tasks used! Copyright © 2014 Accenture LLP. All Rights Reserved. Page 18

Editor's Notes

  1. Hi, I’m Matt Lancaster. I want to talk to you about a topic near and dear to my heart: client side performance optimization.
  2. Sr. Technology Architect / Manager Emerging Tech Cat herding / leading large web projects / Mention AOWP Mention that we’ve created a working architecture with multiple components and have opinions on most out there Battle tested on multiple projects
  3. Disclaimer #1 – Review, Review… Friends don’t let friends (who came over from Java) do the wrong kind of OOP First rule of triage == treat severe but quickly manageable wounds first: you will never get to other worthwhile perf issues if patient dies on the table Premature Opt like… other things done premat, everyone ends up frustrated in end… everyone has bad time Greatest thing since sliced bread to add a bunch of caching layers, don’t
  4. How many of you have perf SLAs? Build complex client-side applications?
  5. grunt-contrib-jshint gulp-jshint grunt-eslint gulp-eslint
  6. grunt-contrib-cssmin gulp-cssmin grunt-inline-css grunt-uncss
  7. grunt-contrib-imagemin gulp-imagemin grunt-responsive-images Imager.js grunt-spritesmith grunt-webfont