SlideShare a Scribd company logo
Automating 
Performance Optimization 
For Modern Web Applications 
Copyright © 2014 Accenture LLP. All Rights Reserved.
Agenda 
• Definitions 
• Disclaimers and Caveats 
• Automating Performance Optimization 
– Methodology 
– Tools 
– JavaScript 
– CSS 
– Images 
– Some Manual (Code Review) Items 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
• Q & A 
• Appendices 
Page 2
What is Perf Automation, anyway? 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 3 
• Make performance optimization part of the 
development process, not just something developers 
are supposed to think about. 
• If performance is not part of the process from the 
beginning, it won’t be thought about until the very 
end! 
Performance Optimization can be made part of the build 
process, and integrated into DevOps. Then it becomes part of 
the daily activity of a development team!
Disclaimers and Caveats 
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 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 5 
time, improving code performance as part of an 
automatic process 
• Scope: performance-related tuning we can do by 
setting up automatic tasks in build/optimize tasks
DevOps for JS Apps 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 6 
Code written & 
check-in 
requested 
Grunt runs automated 
mocha behavior with chai 
assertions and unit tests via 
phantomjs & casperjs 
Grunt provides 
Automated task 
scripting 
Passes 
Automated QA 
Jenkins 
begins 
automated 
build & deploy 
process 
JS Hint runs 
code quality 
tests 
Feedback is 
passed to 
developers 
QA Testers test on multiple devices 
mocha 
Code is packaged 
& readied for 
deploy by Grunt 
Check-in merged to 
Phabricator branch 
for pre-commit 
review by senior 
developers 
Code is deployed to 
test environments by 
Jenkins 
Once code 
review is 
approved, git 
is used to 
push the code 
update to 
sprint branch
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
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 
• Code review, code review, code review... 
… 
… 
Code review!
Tools of the trade 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 9 
or
• 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 10 
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 11 
• 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!
Copyright © 2014 Accenture LLP. All Rights Reserved. 
JavaScript 
Page 12 
• 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
DevOps Integration 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 13 
Code written & 
check-in 
requested 
Grunt runs automated 
mocha behavior with chai 
assertions and unit tests via 
phantomjs & casperjs 
Grunt provides 
Automated task 
scripting 
Passes 
Automated QA 
Jenkins 
begins 
automated 
build & deploy 
process 
JS Hint runs 
code quality 
tests 
Feedback is 
passed to 
developers 
QA Testers test on multiple devices 
mocha 
Code is packaged 
& readied for 
deploy by Grunt 
Check-in merged to 
Phabricator branch 
for pre-commit 
review by senior 
developers 
Code is deployed to 
test environments by 
Jenkins 
Once code 
review is 
approved, git 
is used to 
push the code 
update to 
sprint branch
Questions? 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 14
Appendix: Tasks 
Copyright © 2014 Accenture LLP. All Rights Reserved. 
Page 15 
• 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 
– adept-jpg-compressor

More Related Content

What's hot

The State of Testing 2017
The State of Testing 2017The State of Testing 2017
The State of Testing 2017SmartBear
 
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...ATAGTR2017 Unified APM: The new age performance monitoring for production sys...
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...Agile Testing Alliance
 
Automation Testing Approach for Responsive Web Design
Automation Testing Approach for Responsive Web DesignAutomation Testing Approach for Responsive Web Design
Automation Testing Approach for Responsive Web DesignAgile Testing Alliance
 
Java Test Automation for REST, Web and Mobile
Java Test Automation for REST, Web and MobileJava Test Automation for REST, Web and Mobile
Java Test Automation for REST, Web and MobileElias Nogueira
 
Use Automation to Assist -Not Replace- Manual Testing
Use Automation to Assist -Not Replace- Manual TestingUse Automation to Assist -Not Replace- Manual Testing
Use Automation to Assist -Not Replace- Manual TestingSmartBear
 
How to Get Started with Cypress
How to Get Started with CypressHow to Get Started with Cypress
How to Get Started with CypressApplitools
 
Testing in DevOps world
Testing in DevOps worldTesting in DevOps world
Testing in DevOps worldMoataz Nabil
 
Test driven development_continuous_integration
Test driven development_continuous_integrationTest driven development_continuous_integration
Test driven development_continuous_integrationhaochenglee
 
Continuous integration. Short overview
Continuous integration. Short overviewContinuous integration. Short overview
Continuous integration. Short overviewElifTech
 
Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable productJulian Simpson
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choicetoddbr
 
Swagger in the API Lifecycle
Swagger in the API LifecycleSwagger in the API Lifecycle
Swagger in the API LifecycleOle Lensmar
 
Jenkins as the Test Reporting Framework
Jenkins as the Test Reporting FrameworkJenkins as the Test Reporting Framework
Jenkins as the Test Reporting FrameworkNitin Sharma
 
Testing, CI and CD in the real world
Testing, CI and CD in the real worldTesting, CI and CD in the real world
Testing, CI and CD in the real worldRoc Boronat
 
DevOps - Agile on Steroids by Tom Clement Oketch and Augustine Kisitu
DevOps - Agile on Steroids by Tom Clement Oketch and Augustine KisituDevOps - Agile on Steroids by Tom Clement Oketch and Augustine Kisitu
DevOps - Agile on Steroids by Tom Clement Oketch and Augustine KisituThoughtworks
 
QA Automation testing online training
QA Automation testing online trainingQA Automation testing online training
QA Automation testing online trainingDivya Shree
 
Udvid din test portefølje med coded ui test og cloud load test
Udvid din test portefølje med coded ui test og cloud load testUdvid din test portefølje med coded ui test og cloud load test
Udvid din test portefølje med coded ui test og cloud load testPeter Lindberg
 
Continuous Delivery
Continuous DeliveryContinuous Delivery
Continuous DeliveryMike McGarr
 
Continous Integration: A Case Study
Continous Integration: A Case StudyContinous Integration: A Case Study
Continous Integration: A Case StudyTalentica Software
 

What's hot (20)

The State of Testing 2017
The State of Testing 2017The State of Testing 2017
The State of Testing 2017
 
EVOLVE'15 | Enhance | Rene Ugarte | AEM Quality Assurance
EVOLVE'15 | Enhance | Rene Ugarte | AEM Quality AssuranceEVOLVE'15 | Enhance | Rene Ugarte | AEM Quality Assurance
EVOLVE'15 | Enhance | Rene Ugarte | AEM Quality Assurance
 
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...ATAGTR2017 Unified APM: The new age performance monitoring for production sys...
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...
 
Automation Testing Approach for Responsive Web Design
Automation Testing Approach for Responsive Web DesignAutomation Testing Approach for Responsive Web Design
Automation Testing Approach for Responsive Web Design
 
Java Test Automation for REST, Web and Mobile
Java Test Automation for REST, Web and MobileJava Test Automation for REST, Web and Mobile
Java Test Automation for REST, Web and Mobile
 
Use Automation to Assist -Not Replace- Manual Testing
Use Automation to Assist -Not Replace- Manual TestingUse Automation to Assist -Not Replace- Manual Testing
Use Automation to Assist -Not Replace- Manual Testing
 
How to Get Started with Cypress
How to Get Started with CypressHow to Get Started with Cypress
How to Get Started with Cypress
 
Testing in DevOps world
Testing in DevOps worldTesting in DevOps world
Testing in DevOps world
 
Test driven development_continuous_integration
Test driven development_continuous_integrationTest driven development_continuous_integration
Test driven development_continuous_integration
 
Continuous integration. Short overview
Continuous integration. Short overviewContinuous integration. Short overview
Continuous integration. Short overview
 
Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable product
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
 
Swagger in the API Lifecycle
Swagger in the API LifecycleSwagger in the API Lifecycle
Swagger in the API Lifecycle
 
Jenkins as the Test Reporting Framework
Jenkins as the Test Reporting FrameworkJenkins as the Test Reporting Framework
Jenkins as the Test Reporting Framework
 
Testing, CI and CD in the real world
Testing, CI and CD in the real worldTesting, CI and CD in the real world
Testing, CI and CD in the real world
 
DevOps - Agile on Steroids by Tom Clement Oketch and Augustine Kisitu
DevOps - Agile on Steroids by Tom Clement Oketch and Augustine KisituDevOps - Agile on Steroids by Tom Clement Oketch and Augustine Kisitu
DevOps - Agile on Steroids by Tom Clement Oketch and Augustine Kisitu
 
QA Automation testing online training
QA Automation testing online trainingQA Automation testing online training
QA Automation testing online training
 
Udvid din test portefølje med coded ui test og cloud load test
Udvid din test portefølje med coded ui test og cloud load testUdvid din test portefølje med coded ui test og cloud load test
Udvid din test portefølje med coded ui test og cloud load test
 
Continuous Delivery
Continuous DeliveryContinuous Delivery
Continuous Delivery
 
Continous Integration: A Case Study
Continous Integration: A Case StudyContinous Integration: A Case Study
Continous Integration: A Case Study
 

Similar to Automated perf optimization - html5 dev conf

Automated perf optimization - jQuery Conference
Automated perf optimization - jQuery ConferenceAutomated perf optimization - jQuery Conference
Automated perf optimization - jQuery ConferenceMatthew Lancaster
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous IntegrationXPDays
 
Agile & DevOps - It's all about project success
Agile & DevOps - It's all about project successAgile & DevOps - It's all about project success
Agile & DevOps - It's all about project successAdam Stephensen
 
Making software development processes to work for you
Making software development processes to work for youMaking software development processes to work for you
Making software development processes to work for youAmbientia
 
Dev ops ci-ap-is-oh-my_security-gone-agile_ut-austin
Dev ops ci-ap-is-oh-my_security-gone-agile_ut-austinDev ops ci-ap-is-oh-my_security-gone-agile_ut-austin
Dev ops ci-ap-is-oh-my_security-gone-agile_ut-austinMatt Tesauro
 
Preparing for DevOps
Preparing for DevOpsPreparing for DevOps
Preparing for DevOpsEklove Mohan
 
KrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdfKrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdfQA or the Highway
 
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...SmartBear
 
Introduction to Automated Testing
Introduction to Automated TestingIntroduction to Automated Testing
Introduction to Automated TestingLars Thorup
 
Introduction to-automated-testing
Introduction to-automated-testingIntroduction to-automated-testing
Introduction to-automated-testingBestBrains
 
Harman deepak v - agile on steriod - dev ops led transformation
Harman  deepak v - agile on steriod - dev ops led transformationHarman  deepak v - agile on steriod - dev ops led transformation
Harman deepak v - agile on steriod - dev ops led transformationXebia India
 
Opticon18: Developer Night
Opticon18: Developer NightOpticon18: Developer Night
Opticon18: Developer NightOptimizely
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOpsEklove Mohan
 
Agile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_pptAgile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_pptHitesh Kumar
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development PipelineGlobalLogic Ukraine
 
Application Lifecycle Management
Application Lifecycle ManagementApplication Lifecycle Management
Application Lifecycle ManagementAmazon Web Services
 

Similar to Automated perf optimization - html5 dev conf (20)

Automated perf optimization - jQuery Conference
Automated perf optimization - jQuery ConferenceAutomated perf optimization - jQuery Conference
Automated perf optimization - jQuery Conference
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Agile & DevOps - It's all about project success
Agile & DevOps - It's all about project successAgile & DevOps - It's all about project success
Agile & DevOps - It's all about project success
 
Sencha Services
Sencha ServicesSencha Services
Sencha Services
 
Making software development processes to work for you
Making software development processes to work for youMaking software development processes to work for you
Making software development processes to work for you
 
Dev ops ci-ap-is-oh-my_security-gone-agile_ut-austin
Dev ops ci-ap-is-oh-my_security-gone-agile_ut-austinDev ops ci-ap-is-oh-my_security-gone-agile_ut-austin
Dev ops ci-ap-is-oh-my_security-gone-agile_ut-austin
 
Preparing for DevOps
Preparing for DevOpsPreparing for DevOps
Preparing for DevOps
 
KrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdfKrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdf
 
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
 
Ashish Baraiya
Ashish BaraiyaAshish Baraiya
Ashish Baraiya
 
Introduction to Automated Testing
Introduction to Automated TestingIntroduction to Automated Testing
Introduction to Automated Testing
 
Introduction to-automated-testing
Introduction to-automated-testingIntroduction to-automated-testing
Introduction to-automated-testing
 
Harman deepak v - agile on steriod - dev ops led transformation
Harman  deepak v - agile on steriod - dev ops led transformationHarman  deepak v - agile on steriod - dev ops led transformation
Harman deepak v - agile on steriod - dev ops led transformation
 
Opticon18: Developer Night
Opticon18: Developer NightOpticon18: Developer Night
Opticon18: Developer Night
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
 
Test Policy and Practices
Test Policy and PracticesTest Policy and Practices
Test Policy and Practices
 
Agile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_pptAgile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_ppt
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development Pipeline
 
Quality Software Development
Quality Software DevelopmentQuality Software Development
Quality Software Development
 
Application Lifecycle Management
Application Lifecycle ManagementApplication Lifecycle Management
Application Lifecycle Management
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform EngineeringJemma Hussein Allen
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesThousandEyes
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupCatarinaPereira64715
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Thierry Lestable
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Alison B. Lowndes
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backElena Simperl
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsPaul Groth
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 

Automated perf optimization - html5 dev conf

  • 1. Automating Performance Optimization For Modern Web Applications Copyright © 2014 Accenture LLP. All Rights Reserved.
  • 2. Agenda • Definitions • Disclaimers and Caveats • Automating Performance Optimization – Methodology – Tools – JavaScript – CSS – Images – Some Manual (Code Review) Items Copyright © 2014 Accenture LLP. All Rights Reserved. • Q & A • Appendices Page 2
  • 3. What is Perf Automation, anyway? Copyright © 2014 Accenture LLP. All Rights Reserved. Page 3 • Make performance optimization part of the development process, not just something developers are supposed to think about. • If performance is not part of the process from the beginning, it won’t be thought about until the very end! Performance Optimization can be made part of the build process, and integrated into DevOps. Then it becomes part of the daily activity of a development team!
  • 4. Disclaimers and Caveats 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 Copyright © 2014 Accenture LLP. All Rights Reserved. Page 5 time, improving code performance as part of an automatic process • Scope: performance-related tuning we can do by setting up automatic tasks in build/optimize tasks
  • 6. DevOps for JS Apps Copyright © 2014 Accenture LLP. All Rights Reserved. Page 6 Code written & check-in requested Grunt runs automated mocha behavior with chai assertions and unit tests via phantomjs & casperjs Grunt provides Automated task scripting Passes Automated QA Jenkins begins automated build & deploy process JS Hint runs code quality tests Feedback is passed to developers QA Testers test on multiple devices mocha Code is packaged & readied for deploy by Grunt Check-in merged to Phabricator branch for pre-commit review by senior developers Code is deployed to test environments by Jenkins Once code review is approved, git is used to push the code update to sprint branch
  • 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
  • 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 • Code review, code review, code review... … … Code review!
  • 9. Tools of the trade Copyright © 2014 Accenture LLP. All Rights Reserved. Page 9 or
  • 10. • 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 10 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
  • 11. Copyright © 2014 Accenture LLP. All Rights Reserved. Images Page 11 • 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!
  • 12. Copyright © 2014 Accenture LLP. All Rights Reserved. JavaScript Page 12 • 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
  • 13. DevOps Integration Copyright © 2014 Accenture LLP. All Rights Reserved. Page 13 Code written & check-in requested Grunt runs automated mocha behavior with chai assertions and unit tests via phantomjs & casperjs Grunt provides Automated task scripting Passes Automated QA Jenkins begins automated build & deploy process JS Hint runs code quality tests Feedback is passed to developers QA Testers test on multiple devices mocha Code is packaged & readied for deploy by Grunt Check-in merged to Phabricator branch for pre-commit review by senior developers Code is deployed to test environments by Jenkins Once code review is approved, git is used to push the code update to sprint branch
  • 14. Questions? Copyright © 2014 Accenture LLP. All Rights Reserved. Page 14
  • 15. Appendix: Tasks Copyright © 2014 Accenture LLP. All Rights Reserved. Page 15 • 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 – adept-jpg-compressor

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. 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
  3. How many of you have perf SLAs? Build complex client-side applications?
  4. grunt-contrib-cssmin gulp-cssmin grunt-inline-css grunt-uncss
  5. grunt-contrib-imagemin gulp-imagemin grunt-responsive-images Imager.js grunt-spritesmith grunt-webfont
  6. grunt-contrib-jshint gulp-jshint grunt-eslint gulp-eslint