SlideShare une entreprise Scribd logo
1  sur  43
Télécharger pour lire hors ligne
Techniques to Speed Up Your Build Pipeline 
ashish.parkhi@ideas.comnaresh@agilefaqs.com 
@AshishParkhi@nashjain 
ashishparkhi.comnareshjain.com
Build Pipeline -Best Case to Worst Case time. 
About60 to90 minutes
Impact on life 
Image source – http://ak3.picdn.net/shutterstock/videos/5132438/preview/stock-footage-mixed-ethnicity-group-of-medical-professionals-working-late-at-night-are-looking- 
at-a-computer.jpg 
http://the247analyst.files.wordpress.com/2011/10/dealing-with-pressure.jpg 
http://www.dimitri.co.uk/business/business-images/worker-alone-dark-office.jpg 
http://cdn.sheknows.com/articles/2012/10/crying-little-girl.jpg
Build Pipeline –Now takes 10 to 12 Minutes
Focus on the Bottlenecks 
Divide and Conquer 
Key Principles to Speed Up Your Build Pipeline 
Fail Fast
Commercial Break 
ashish.parkhi@ideas.comnaresh@agilefaqs.com 
@AshishParkhi@nashjain 
ashishparkhi.comnareshjain.com
Focus on the Bottlenecks 
Divide and Conquer 
Key Principles to Speed Up Your Build Pipeline 
Fail Fast
Disk IO –Example 
File Operations 
Focus on Bottleneck
Disk IO –Example 
Database operations. Image Source - https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTPdVawndjUZbU2PDn-oKgjBPqmgDqr3PPZatZh9kxEgNi71AND 
http://www.dba-oracle.com/images/large_disk_hot_files.gif 
Focus on Bottleneck
Disk IO –Alternative 
Image Source - http://3.bp.blogspot.com/-bqTjSN7pSpg/UbqyjVojEFI/AAAAAAAADBw/PWe0kiuRHJ4/s200/no+duplicate+content.jpg 
•Avoid file operations –e.g. duplicating workspace 
Focus on Bottleneck
Disk IO –Alternative 
•Avoid file operations –e.g. Jar creation. 
Focus on Bottleneck 
Image Source - http://i1.wp.com/blog.quoteroller.com/wp-content/uploads/2013/04/Dont-start-from-scratch.png?resize=800%2C264
Disk IO –Alternative 
Image source - http://4.bp.blogspot.com/_4hvqisoH9CE/TSZIs7eiSAI/AAAAAAAAA7E/vanj6bGD8XQ/s1600/big-vs-small-left.jpg 
•Test on smaller but apt data set. 
Focus on Bottleneck
Disk IO –Alternative -SSD 
CrystalDiskMark - http://crystalmark.info/software/CrystalDiskMark/index-e.html 
•HDD (Toshiba MQ01ACF050 500GB SATA III) vs SSD (Samsung PM851 512GB mSata) 
Focus on Bottleneck
Disk IO –Alternative -SSD 
•HDDSSD 
Focus on Bottleneck
Disk IO –Alternative -In Memory DB 
Memory (Heap) Engine 
–had some limitations over myisamengine. 
Focus on Bottleneck
Disk IO –Alternative -In Memory DB 
–was not supporting many MySQL queries so was discarded. 
Focus on Bottleneck
Disk IO –Alternative -In Memory DB 
database 
–looked promising as it could support many MySQL queries but still required couple of modifications to our code. 
Focus on Bottleneck
Disk IO –Alternative -In Memory DB 
–looked most promising as it is wire compatible with MySQL, which means without code changes I could just point to memsql and be done with it. 
Focus on Bottleneck
Disk IO –Alternative -RAM Drive 
•SoftPerfect RAM Disk 
Focus on Bottleneck
Disk IO –Alternative –RAM Drive 
•RAM Drive 
Focus on Bottleneck
Disk IO –Alternative –RAM Drive 
•RAM Drive –did not work 
Focus on Bottleneck
Disk IO –Alternative –RAM Drive 
•RAM Drive –did not work 
Focus on Bottleneck
CPU -Profiling 
Focus on Bottleneck
CPU –Profiling -Insights 
Image source - https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQde6NeSrbuv40CIhKtFa1OuIQXf7F7esMJKp1Ie7zmH2t29l6Z 
Scanningresource bundle files from jars. 
Focus on Bottleneck
CPU –Profiling -Insights 
Image source - http://2.bp.blogspot.com/-uKMyLlB3F7o/Tqn_6yqdElI/AAAAAAAAB94/_1FMbHJFQBQ/s1600/weight-lift-cartoon.jpg 
Loading Spring Application Context. 
Focus on Bottleneck
CPU –Profiling -Insights 
Image source - http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/00000/7000/000/7029/7029.strip.gif 
Avoiding unnecessary activities during build e.g. sending out email. 
Focus on Bottleneck
CPU –Profiling -Insights 
java.util.Calendaris horribly slow. 
Total processing time took 20.72minutes out of which Date Arithmetic took 18.15minutes which is about 87.6%of the total processing time! 
Focus on Bottleneck
CPU –Profiling -Insights 
java.util.Calendaris horribly slow. We switched to jodadate library and deprecated java.util.DateAPI. 
Now Date Arithmetic takes 1.30minutes; that’s a massive saving of 93.77% 
Focus on Bottleneck
CPU -ANT 1.7 Junit task options. 
Focus on Bottleneck
Focus on the Bottlenecks 
Divide and Conquer 
Key Principles to Speed Up Your Build Pipeline 
Fail Fast
CPU -Running Tests Concurrently 
•Create parallel jobs. 
Divide and Conquer
CPU -Running Tests Concurrently 
•Distribute tasks across multiple slaves. 
Divide and Conquer 
Image source -https://wiki.jenkins-ci.org/download/attachments/2916393/logo.png?version=1&modificationDate=1302753947000
CPU -Running Tests Concurrently 
Image source - http://sharpreflections.com/wp-content/uploads/2012/06/multi_core_cpu.png 
•Using @RunWith(ConcurrentJunitRunner.class). 
–Curtesy -Mathieu Carbou http://java.dzone.com/articles/concurrent- junit-tests 
–Maven Surefire plugin has built in mechanism. 
Divide and Conquer
Focus on the Bottlenecks 
Divide and Conquer 
Key Principles to Speed Up Your Build Pipeline 
Fail Fast
Restructure The Build Pipeline 
Image Source - http://javapapers.com/wp-content/uploads/2012/11/failfast.jpg 
•We want our builds to give us fast feedback. Hence it is very important to prioritise your build tasks based on what is most likely to fail first. 
•Push unnecessary stuff to a separate build –Things like JavaDocs can be done nightly. 
•Separate out fast and slow running tests. 
Fail Fast
Incremental Build vs. Clean Build 
•Local dev builds are incremental, instead of clean builds, as it helps with faster feedback and fail fast. 
Fail Fast
Prioritize Test 
•We prioritize and group our tests so that the tests which are fast and mostly likely to fail are run first. 
–ProTest framework 
Fail Fast
Summary 
•Focus on bottlenecks 
–Avoid Disk IO -File operations, file based database operations. 
–Use smaller datasets. 
–Use in-memory databases, Ram Drives, SSDs. 
–Perform CPU profiling, scan logs, to uncover the unknown. 
–Verify build tool settings. 
•Divide and Conquer 
–Create smaller jobs that can run in parallel. 
–Distribute jobs across multiple slaves. 
–Write tests that can run in isolation and use ConcurrentJunitRunnerto run them in parallel. 
•Fail Fast 
–Restructure the build pipeline to uncover failures soon. 
–Incremental Builds 
–Prioritize tests.
Build Time Vs No Of Builds 
Removed Workspace Duplication 
Ant Junit Task –Fork Once 
Ram Disk 
Caching Resource 
Caching Spring Context 
Avoided Email 
Joda DateTime 
Deprecated Date API 
Concurrent Junit Runner
Impact on life 
Image source - http://t3.gstatic.com/images?q=tbn:ANd9GcTCvK8pY5qcp7Gl3ZBjxN1mc1HVHdiy1sQhByKeGgUk_5eJuUk7cA 
https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQpoUXqhEpdGl1cLzn4gQsng_GyxUmOKWxYUH6GfrjN_FRUYPxw-Q
Resources 
•Jenkins –http://jenkins-ci.org/ 
•CI –http://en.wikipedia.org/wiki/Continuous_integration 
•Mklink –http://technet.microsoft.com/en-us/library/cc753194.aspx 
•http://ant.apache.org/manual/Tasks/junit.html 
•http://java.dzone.com/articles/javalangoutofmemory-permgen 
•SSD –http://en.wikipedia.org/wiki/Solid-state_drive 
•Hybrid disk –http://en.wikipedia.org/wiki/Hybrid_drive 
•HSQL –http://hsqldb.org/ 
•H2 –http://www.h2database.com/html/main.html 
•Memsql –http://www.memsql.com/ 
•MySQL is bazillion times faster than MemSQL 
•Tmpfs –http://en.wikipedia.org/wiki/Tmpfs 
•http://blog.laptopmag.com/faster-than-an-ssd-how-to-turn-extra-memory-into-a-ram-disk 
•RAM Disk Software Benchmarked 
•http://jvmmonitor.org/ 
•http://searchvmware.techtarget.com/tip/VMware-snapshot-size-and-other-causes-for-slow- snapshots 
•http://blogs.agilefaqs.com/2014/10/03/key-principles-for-reducing-continuous-integration-build- time/ 
•http://googletesting.blogspot.com/2011/06/testing-at-speed-and-scale-of-google.html 
•http://www.infoq.com/presentations/Development-at-Google 
•http://crystalmark.info/software/CrystalDiskMark/index-e.html
© Copyright Integrated Decisions and Systems, Inc. (IDeaS –A SAS COMPANY) 
Visit IDeaS online at www.ideas.com 
Thank you. 
ashish.parkhi@ideas.comnaresh@agilefaqs.com 
@AshishParkhi@nashjain 
ashishparkhi.comnareshjain.com

Contenu connexe

Plus de Naresh Jain

Agile India 2018 Conference
Agile India 2018 ConferenceAgile India 2018 Conference
Agile India 2018 ConferenceNaresh Jain
 
Agile India 2018 Conference
Agile India 2018 ConferenceAgile India 2018 Conference
Agile India 2018 ConferenceNaresh Jain
 
Agile India 2018 Conference
Agile India 2018 ConferenceAgile India 2018 Conference
Agile India 2018 ConferenceNaresh Jain
 
Pilgrim's Progress to the Promised Land by Robert Virding
Pilgrim's Progress to the Promised Land by Robert VirdingPilgrim's Progress to the Promised Land by Robert Virding
Pilgrim's Progress to the Promised Land by Robert VirdingNaresh Jain
 
Concurrent languages are Functional by Francesco Cesarini
Concurrent languages are Functional by Francesco CesariniConcurrent languages are Functional by Francesco Cesarini
Concurrent languages are Functional by Francesco CesariniNaresh Jain
 
Erlang from behing the trenches by Francesco Cesarini
Erlang from behing the trenches by Francesco CesariniErlang from behing the trenches by Francesco Cesarini
Erlang from behing the trenches by Francesco CesariniNaresh Jain
 
Anatomy of an eCommerce Search Engine by Mayur Datar
Anatomy of an eCommerce Search Engine by Mayur DatarAnatomy of an eCommerce Search Engine by Mayur Datar
Anatomy of an eCommerce Search Engine by Mayur DatarNaresh Jain
 
Setting up Continuous Delivery Culture for a Large Scale Mobile App
Setting up Continuous Delivery Culture for a Large Scale Mobile AppSetting up Continuous Delivery Culture for a Large Scale Mobile App
Setting up Continuous Delivery Culture for a Large Scale Mobile AppNaresh Jain
 
Towards FutureOps: Stable, Repeatable environments from Dev to Prod
Towards FutureOps: Stable, Repeatable environments from Dev to ProdTowards FutureOps: Stable, Repeatable environments from Dev to Prod
Towards FutureOps: Stable, Repeatable environments from Dev to ProdNaresh Jain
 
Value Driven Development by Dave Thomas
Value Driven Development by Dave Thomas Value Driven Development by Dave Thomas
Value Driven Development by Dave Thomas Naresh Jain
 
No Silver Bullets in Functional Programming by Brian McKenna
No Silver Bullets in Functional Programming by Brian McKennaNo Silver Bullets in Functional Programming by Brian McKenna
No Silver Bullets in Functional Programming by Brian McKennaNaresh Jain
 
Functional Programming Conference 2016
Functional Programming Conference 2016Functional Programming Conference 2016
Functional Programming Conference 2016Naresh Jain
 
Agile India 2017 Conference
Agile India 2017 ConferenceAgile India 2017 Conference
Agile India 2017 ConferenceNaresh Jain
 
Unleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDTUnleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDTNaresh Jain
 
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo KimGetting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo KimNaresh Jain
 
MVP Design Hacks
MVP Design HacksMVP Design Hacks
MVP Design HacksNaresh Jain
 
Functional Conf 2015
Functional Conf 2015Functional Conf 2015
Functional Conf 2015Naresh Jain
 
Agile India 2016 Conference
Agile India 2016 ConferenceAgile India 2016 Conference
Agile India 2016 ConferenceNaresh Jain
 
Test Driving a jQuery Plugin
Test Driving a jQuery PluginTest Driving a jQuery Plugin
Test Driving a jQuery PluginNaresh Jain
 

Plus de Naresh Jain (20)

Agile India 2018 Conference
Agile India 2018 ConferenceAgile India 2018 Conference
Agile India 2018 Conference
 
Agile India 2018 Conference
Agile India 2018 ConferenceAgile India 2018 Conference
Agile India 2018 Conference
 
Agile India 2018 Conference
Agile India 2018 ConferenceAgile India 2018 Conference
Agile India 2018 Conference
 
Pilgrim's Progress to the Promised Land by Robert Virding
Pilgrim's Progress to the Promised Land by Robert VirdingPilgrim's Progress to the Promised Land by Robert Virding
Pilgrim's Progress to the Promised Land by Robert Virding
 
Concurrent languages are Functional by Francesco Cesarini
Concurrent languages are Functional by Francesco CesariniConcurrent languages are Functional by Francesco Cesarini
Concurrent languages are Functional by Francesco Cesarini
 
Erlang from behing the trenches by Francesco Cesarini
Erlang from behing the trenches by Francesco CesariniErlang from behing the trenches by Francesco Cesarini
Erlang from behing the trenches by Francesco Cesarini
 
Anatomy of an eCommerce Search Engine by Mayur Datar
Anatomy of an eCommerce Search Engine by Mayur DatarAnatomy of an eCommerce Search Engine by Mayur Datar
Anatomy of an eCommerce Search Engine by Mayur Datar
 
Setting up Continuous Delivery Culture for a Large Scale Mobile App
Setting up Continuous Delivery Culture for a Large Scale Mobile AppSetting up Continuous Delivery Culture for a Large Scale Mobile App
Setting up Continuous Delivery Culture for a Large Scale Mobile App
 
Towards FutureOps: Stable, Repeatable environments from Dev to Prod
Towards FutureOps: Stable, Repeatable environments from Dev to ProdTowards FutureOps: Stable, Repeatable environments from Dev to Prod
Towards FutureOps: Stable, Repeatable environments from Dev to Prod
 
Value Driven Development by Dave Thomas
Value Driven Development by Dave Thomas Value Driven Development by Dave Thomas
Value Driven Development by Dave Thomas
 
No Silver Bullets in Functional Programming by Brian McKenna
No Silver Bullets in Functional Programming by Brian McKennaNo Silver Bullets in Functional Programming by Brian McKenna
No Silver Bullets in Functional Programming by Brian McKenna
 
Functional Programming Conference 2016
Functional Programming Conference 2016Functional Programming Conference 2016
Functional Programming Conference 2016
 
Agile India 2017 Conference
Agile India 2017 ConferenceAgile India 2017 Conference
Agile India 2017 Conference
 
The Eclipse Way
The Eclipse WayThe Eclipse Way
The Eclipse Way
 
Unleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDTUnleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDT
 
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo KimGetting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
 
MVP Design Hacks
MVP Design HacksMVP Design Hacks
MVP Design Hacks
 
Functional Conf 2015
Functional Conf 2015Functional Conf 2015
Functional Conf 2015
 
Agile India 2016 Conference
Agile India 2016 ConferenceAgile India 2016 Conference
Agile India 2016 Conference
 
Test Driving a jQuery Plugin
Test Driving a jQuery PluginTest Driving a jQuery Plugin
Test Driving a jQuery Plugin
 

Dernier

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 

Dernier (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 

Techniques to Speed up your Build Pipeline

  • 1.
  • 2. Techniques to Speed Up Your Build Pipeline ashish.parkhi@ideas.comnaresh@agilefaqs.com @AshishParkhi@nashjain ashishparkhi.comnareshjain.com
  • 3. Build Pipeline -Best Case to Worst Case time. About60 to90 minutes
  • 4. Impact on life Image source – http://ak3.picdn.net/shutterstock/videos/5132438/preview/stock-footage-mixed-ethnicity-group-of-medical-professionals-working-late-at-night-are-looking- at-a-computer.jpg http://the247analyst.files.wordpress.com/2011/10/dealing-with-pressure.jpg http://www.dimitri.co.uk/business/business-images/worker-alone-dark-office.jpg http://cdn.sheknows.com/articles/2012/10/crying-little-girl.jpg
  • 5. Build Pipeline –Now takes 10 to 12 Minutes
  • 6. Focus on the Bottlenecks Divide and Conquer Key Principles to Speed Up Your Build Pipeline Fail Fast
  • 7. Commercial Break ashish.parkhi@ideas.comnaresh@agilefaqs.com @AshishParkhi@nashjain ashishparkhi.comnareshjain.com
  • 8. Focus on the Bottlenecks Divide and Conquer Key Principles to Speed Up Your Build Pipeline Fail Fast
  • 9. Disk IO –Example File Operations Focus on Bottleneck
  • 10. Disk IO –Example Database operations. Image Source - https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTPdVawndjUZbU2PDn-oKgjBPqmgDqr3PPZatZh9kxEgNi71AND http://www.dba-oracle.com/images/large_disk_hot_files.gif Focus on Bottleneck
  • 11. Disk IO –Alternative Image Source - http://3.bp.blogspot.com/-bqTjSN7pSpg/UbqyjVojEFI/AAAAAAAADBw/PWe0kiuRHJ4/s200/no+duplicate+content.jpg •Avoid file operations –e.g. duplicating workspace Focus on Bottleneck
  • 12. Disk IO –Alternative •Avoid file operations –e.g. Jar creation. Focus on Bottleneck Image Source - http://i1.wp.com/blog.quoteroller.com/wp-content/uploads/2013/04/Dont-start-from-scratch.png?resize=800%2C264
  • 13. Disk IO –Alternative Image source - http://4.bp.blogspot.com/_4hvqisoH9CE/TSZIs7eiSAI/AAAAAAAAA7E/vanj6bGD8XQ/s1600/big-vs-small-left.jpg •Test on smaller but apt data set. Focus on Bottleneck
  • 14. Disk IO –Alternative -SSD CrystalDiskMark - http://crystalmark.info/software/CrystalDiskMark/index-e.html •HDD (Toshiba MQ01ACF050 500GB SATA III) vs SSD (Samsung PM851 512GB mSata) Focus on Bottleneck
  • 15. Disk IO –Alternative -SSD •HDDSSD Focus on Bottleneck
  • 16. Disk IO –Alternative -In Memory DB Memory (Heap) Engine –had some limitations over myisamengine. Focus on Bottleneck
  • 17. Disk IO –Alternative -In Memory DB –was not supporting many MySQL queries so was discarded. Focus on Bottleneck
  • 18. Disk IO –Alternative -In Memory DB database –looked promising as it could support many MySQL queries but still required couple of modifications to our code. Focus on Bottleneck
  • 19. Disk IO –Alternative -In Memory DB –looked most promising as it is wire compatible with MySQL, which means without code changes I could just point to memsql and be done with it. Focus on Bottleneck
  • 20. Disk IO –Alternative -RAM Drive •SoftPerfect RAM Disk Focus on Bottleneck
  • 21. Disk IO –Alternative –RAM Drive •RAM Drive Focus on Bottleneck
  • 22. Disk IO –Alternative –RAM Drive •RAM Drive –did not work Focus on Bottleneck
  • 23. Disk IO –Alternative –RAM Drive •RAM Drive –did not work Focus on Bottleneck
  • 24. CPU -Profiling Focus on Bottleneck
  • 25. CPU –Profiling -Insights Image source - https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQde6NeSrbuv40CIhKtFa1OuIQXf7F7esMJKp1Ie7zmH2t29l6Z Scanningresource bundle files from jars. Focus on Bottleneck
  • 26. CPU –Profiling -Insights Image source - http://2.bp.blogspot.com/-uKMyLlB3F7o/Tqn_6yqdElI/AAAAAAAAB94/_1FMbHJFQBQ/s1600/weight-lift-cartoon.jpg Loading Spring Application Context. Focus on Bottleneck
  • 27. CPU –Profiling -Insights Image source - http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/00000/7000/000/7029/7029.strip.gif Avoiding unnecessary activities during build e.g. sending out email. Focus on Bottleneck
  • 28. CPU –Profiling -Insights java.util.Calendaris horribly slow. Total processing time took 20.72minutes out of which Date Arithmetic took 18.15minutes which is about 87.6%of the total processing time! Focus on Bottleneck
  • 29. CPU –Profiling -Insights java.util.Calendaris horribly slow. We switched to jodadate library and deprecated java.util.DateAPI. Now Date Arithmetic takes 1.30minutes; that’s a massive saving of 93.77% Focus on Bottleneck
  • 30. CPU -ANT 1.7 Junit task options. Focus on Bottleneck
  • 31. Focus on the Bottlenecks Divide and Conquer Key Principles to Speed Up Your Build Pipeline Fail Fast
  • 32. CPU -Running Tests Concurrently •Create parallel jobs. Divide and Conquer
  • 33. CPU -Running Tests Concurrently •Distribute tasks across multiple slaves. Divide and Conquer Image source -https://wiki.jenkins-ci.org/download/attachments/2916393/logo.png?version=1&modificationDate=1302753947000
  • 34. CPU -Running Tests Concurrently Image source - http://sharpreflections.com/wp-content/uploads/2012/06/multi_core_cpu.png •Using @RunWith(ConcurrentJunitRunner.class). –Curtesy -Mathieu Carbou http://java.dzone.com/articles/concurrent- junit-tests –Maven Surefire plugin has built in mechanism. Divide and Conquer
  • 35. Focus on the Bottlenecks Divide and Conquer Key Principles to Speed Up Your Build Pipeline Fail Fast
  • 36. Restructure The Build Pipeline Image Source - http://javapapers.com/wp-content/uploads/2012/11/failfast.jpg •We want our builds to give us fast feedback. Hence it is very important to prioritise your build tasks based on what is most likely to fail first. •Push unnecessary stuff to a separate build –Things like JavaDocs can be done nightly. •Separate out fast and slow running tests. Fail Fast
  • 37. Incremental Build vs. Clean Build •Local dev builds are incremental, instead of clean builds, as it helps with faster feedback and fail fast. Fail Fast
  • 38. Prioritize Test •We prioritize and group our tests so that the tests which are fast and mostly likely to fail are run first. –ProTest framework Fail Fast
  • 39. Summary •Focus on bottlenecks –Avoid Disk IO -File operations, file based database operations. –Use smaller datasets. –Use in-memory databases, Ram Drives, SSDs. –Perform CPU profiling, scan logs, to uncover the unknown. –Verify build tool settings. •Divide and Conquer –Create smaller jobs that can run in parallel. –Distribute jobs across multiple slaves. –Write tests that can run in isolation and use ConcurrentJunitRunnerto run them in parallel. •Fail Fast –Restructure the build pipeline to uncover failures soon. –Incremental Builds –Prioritize tests.
  • 40. Build Time Vs No Of Builds Removed Workspace Duplication Ant Junit Task –Fork Once Ram Disk Caching Resource Caching Spring Context Avoided Email Joda DateTime Deprecated Date API Concurrent Junit Runner
  • 41. Impact on life Image source - http://t3.gstatic.com/images?q=tbn:ANd9GcTCvK8pY5qcp7Gl3ZBjxN1mc1HVHdiy1sQhByKeGgUk_5eJuUk7cA https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQpoUXqhEpdGl1cLzn4gQsng_GyxUmOKWxYUH6GfrjN_FRUYPxw-Q
  • 42. Resources •Jenkins –http://jenkins-ci.org/ •CI –http://en.wikipedia.org/wiki/Continuous_integration •Mklink –http://technet.microsoft.com/en-us/library/cc753194.aspx •http://ant.apache.org/manual/Tasks/junit.html •http://java.dzone.com/articles/javalangoutofmemory-permgen •SSD –http://en.wikipedia.org/wiki/Solid-state_drive •Hybrid disk –http://en.wikipedia.org/wiki/Hybrid_drive •HSQL –http://hsqldb.org/ •H2 –http://www.h2database.com/html/main.html •Memsql –http://www.memsql.com/ •MySQL is bazillion times faster than MemSQL •Tmpfs –http://en.wikipedia.org/wiki/Tmpfs •http://blog.laptopmag.com/faster-than-an-ssd-how-to-turn-extra-memory-into-a-ram-disk •RAM Disk Software Benchmarked •http://jvmmonitor.org/ •http://searchvmware.techtarget.com/tip/VMware-snapshot-size-and-other-causes-for-slow- snapshots •http://blogs.agilefaqs.com/2014/10/03/key-principles-for-reducing-continuous-integration-build- time/ •http://googletesting.blogspot.com/2011/06/testing-at-speed-and-scale-of-google.html •http://www.infoq.com/presentations/Development-at-Google •http://crystalmark.info/software/CrystalDiskMark/index-e.html
  • 43. © Copyright Integrated Decisions and Systems, Inc. (IDeaS –A SAS COMPANY) Visit IDeaS online at www.ideas.com Thank you. ashish.parkhi@ideas.comnaresh@agilefaqs.com @AshishParkhi@nashjain ashishparkhi.comnareshjain.com