SlideShare a Scribd company logo
Optimizing Gradle Builds
Strategies to Identify, Resolve, and Avoid Cache Issues
Sinan Kozak
Sinan Kozak
Google Developer Expert
Staff Android Developer @DeliveryHero
Fast CI results? Quick local builds?
CI/CD is mostly more centralized in Delivery Hero.
Bigger customer team has splitted infra teams per topic, but
Logistics Tribe has one Mobile Infra.
Practical optimizations with tradeoffs are very critical.
Cycle time increase incident - March 24
90+ minutes
Long PR checks are unacceptable
What does bad look like?
How did it start?
Initial usage
Full migration
Convention plugin
and more tests
CI cost and Cycle time had skyrocketed
Why didn’t we notice earlier?
We had other planned changes that increased CI time.
● Running lint on test code
● Detect verification per commit
Build Benchmark
We use Gradle Profiler on CI to compare times
● Incremental build for ABI and non-ABI changes in critical modules
● Gradle Enterprise scan comparison
We didn’t have profiling for;
● Unit test compile
● Android test compile
Impact analysis
Problem grow with number of feature with screenshot test
● Convention plugin and training increased the speed
● 60+ of 450 modules has screenshot tests now
PR Check CI steps
● Checkout
● Setup
● Lint + Detect
● Unit Test
○ testDebugUnitTest
● Screenshot test
○ verifyPaparazziDebug
● Coverage
○ JoCoCo + dependOn(Test Tasks)
Why does Gradle disable cache for test task?
Where are details? What is output $2
-Dorg.gradle.caching.debug=true
Let’s investigate
Paparazzi suppose to be fast and run on JVM like any other junit test.
● Yes, it is faster to run.
● Yes, it runs on JVM. We don’t need emulator
● But, but, but…
Paparazzi Gradle Plugin configures the Test task
even for non Paparazzi tests!!
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
What would be nice setup?
● Verify screenshot tests by default
○ Create aggregated report on demand
○ Fail unit test when screenshot test fail
● Make screenshots folder input of tasks for verification case
○ Screenshots are input of verification
● Remove reports path as output. Html report aggregates with every run.
○ Reports are not reproducible.
● Record task is never up to date when we run record
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
90m -> 35m
~60% improvement after changing a Paparazzi Plugin setup.
Don’t modify cacheability of other tasks
But our devs never use the report
What will we work on next?
More benchmark cases on CI with Gradle Profile
● Unit test and Android Test builds
Make profiling automatic and blocker for certain type of PRs
● Dependency changes
Maintain internal Paparazzi plugin unless they change the defaults
https://github.com/cashapp/paparazzi/issues/1334
https://github.com/cashapp/paparazzi/issues/1365
Gist of modified Paparazzi Plugin
https://gist.github.com/kozaxinan/4b44f817b28ac409f950c041c3627eca
Thank you
Q&A?
Sinan Kozak
@snnkzk

More Related Content

Similar to Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024

Continuous delivery install core, ironsource
Continuous delivery install core, ironsourceContinuous delivery install core, ironsource
Continuous delivery install core, ironsource
ari-el
 
GTAC 2015
GTAC 2015GTAC 2015
GTAC 2015
Dino Su
 
通往測試最高殿堂的旅程 - GTAC 2016
通往測試最高殿堂的旅程 - GTAC 2016通往測試最高殿堂的旅程 - GTAC 2016
通往測試最高殿堂的旅程 - GTAC 2016
Chloe Chen
 
Skip Staging! Test Docker, Helm, and Kubernetes Apps like a Pro
Skip Staging! Test Docker, Helm, and Kubernetes Apps like a ProSkip Staging! Test Docker, Helm, and Kubernetes Apps like a Pro
Skip Staging! Test Docker, Helm, and Kubernetes Apps like a Pro
Codefresh
 
Continuous Delivery at Snyk
Continuous Delivery at SnykContinuous Delivery at Snyk
Continuous Delivery at Snyk
Anton Drukh
 
Search microservice
Search microserviceSearch microservice
Search microservice
Jean Carlo Machado
 
Moving to tdd bdd
Moving to tdd bddMoving to tdd bdd
Moving to tdd bdd
Kim Carter
 
Tce automation-d4
Tce automation-d4Tce automation-d4
Tce automation-d4
Tikal Knowledge
 
Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and Jenkins
SOASTA
 
All you need is fast feedback loop, fast feedback loop, fast feedback loop is...
All you need is fast feedback loop, fast feedback loop, fast feedback loop is...All you need is fast feedback loop, fast feedback loop, fast feedback loop is...
All you need is fast feedback loop, fast feedback loop, fast feedback loop is...
Nacho Cougil
 
Continuous integration (eng)
Continuous integration (eng)Continuous integration (eng)
Continuous integration (eng)
Anatoliy Okhotnikov
 
Building the Ideal CI-CD Pipeline_ Achieving Visual Perfection
Building the Ideal CI-CD Pipeline_ Achieving Visual PerfectionBuilding the Ideal CI-CD Pipeline_ Achieving Visual Perfection
Building the Ideal CI-CD Pipeline_ Achieving Visual Perfection
Applitools
 
Getting started with karate dsl
Getting started with karate dslGetting started with karate dsl
Getting started with karate dsl
Knoldus Inc.
 
Continuous Delivery Testing @HiQ
Continuous Delivery Testing @HiQContinuous Delivery Testing @HiQ
Continuous Delivery Testing @HiQ
Tomas Riha
 
AUG NYC June 12 - Event Presentations
AUG NYC June 12 - Event PresentationsAUG NYC June 12 - Event Presentations
AUG NYC June 12 - Event Presentations
Madhusudhan Matrubai
 
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
dcieslak
 
Performance engineering10042915
Performance engineering10042915Performance engineering10042915
Performance engineering10042915
Deepti Bhutani
 
Best practices ensuring a successful implementation
Best practices ensuring a successful implementationBest practices ensuring a successful implementation
Best practices ensuring a successful implementation
ForgeRock
 
Developer Productivity Engineering with Gradle
Developer Productivity Engineering with GradleDeveloper Productivity Engineering with Gradle
Developer Productivity Engineering with Gradle
All Things Open
 
Aws uk ug #8 not everything that happens in vegas stay in vegas
Aws uk ug #8   not everything that happens in vegas stay in vegasAws uk ug #8   not everything that happens in vegas stay in vegas
Aws uk ug #8 not everything that happens in vegas stay in vegas
Peter Mounce
 

Similar to Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024 (20)

Continuous delivery install core, ironsource
Continuous delivery install core, ironsourceContinuous delivery install core, ironsource
Continuous delivery install core, ironsource
 
GTAC 2015
GTAC 2015GTAC 2015
GTAC 2015
 
通往測試最高殿堂的旅程 - GTAC 2016
通往測試最高殿堂的旅程 - GTAC 2016通往測試最高殿堂的旅程 - GTAC 2016
通往測試最高殿堂的旅程 - GTAC 2016
 
Skip Staging! Test Docker, Helm, and Kubernetes Apps like a Pro
Skip Staging! Test Docker, Helm, and Kubernetes Apps like a ProSkip Staging! Test Docker, Helm, and Kubernetes Apps like a Pro
Skip Staging! Test Docker, Helm, and Kubernetes Apps like a Pro
 
Continuous Delivery at Snyk
Continuous Delivery at SnykContinuous Delivery at Snyk
Continuous Delivery at Snyk
 
Search microservice
Search microserviceSearch microservice
Search microservice
 
Moving to tdd bdd
Moving to tdd bddMoving to tdd bdd
Moving to tdd bdd
 
Tce automation-d4
Tce automation-d4Tce automation-d4
Tce automation-d4
 
Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and Jenkins
 
All you need is fast feedback loop, fast feedback loop, fast feedback loop is...
All you need is fast feedback loop, fast feedback loop, fast feedback loop is...All you need is fast feedback loop, fast feedback loop, fast feedback loop is...
All you need is fast feedback loop, fast feedback loop, fast feedback loop is...
 
Continuous integration (eng)
Continuous integration (eng)Continuous integration (eng)
Continuous integration (eng)
 
Building the Ideal CI-CD Pipeline_ Achieving Visual Perfection
Building the Ideal CI-CD Pipeline_ Achieving Visual PerfectionBuilding the Ideal CI-CD Pipeline_ Achieving Visual Perfection
Building the Ideal CI-CD Pipeline_ Achieving Visual Perfection
 
Getting started with karate dsl
Getting started with karate dslGetting started with karate dsl
Getting started with karate dsl
 
Continuous Delivery Testing @HiQ
Continuous Delivery Testing @HiQContinuous Delivery Testing @HiQ
Continuous Delivery Testing @HiQ
 
AUG NYC June 12 - Event Presentations
AUG NYC June 12 - Event PresentationsAUG NYC June 12 - Event Presentations
AUG NYC June 12 - Event Presentations
 
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
 
Performance engineering10042915
Performance engineering10042915Performance engineering10042915
Performance engineering10042915
 
Best practices ensuring a successful implementation
Best practices ensuring a successful implementationBest practices ensuring a successful implementation
Best practices ensuring a successful implementation
 
Developer Productivity Engineering with Gradle
Developer Productivity Engineering with GradleDeveloper Productivity Engineering with Gradle
Developer Productivity Engineering with Gradle
 
Aws uk ug #8 not everything that happens in vegas stay in vegas
Aws uk ug #8   not everything that happens in vegas stay in vegasAws uk ug #8   not everything that happens in vegas stay in vegas
Aws uk ug #8 not everything that happens in vegas stay in vegas
 

Recently uploaded

API-1150WB-Cooling Towers.pdf with details
API-1150WB-Cooling Towers.pdf with detailsAPI-1150WB-Cooling Towers.pdf with details
API-1150WB-Cooling Towers.pdf with details
MuhammadUsmanAsghar4
 
OME754 – INDUSTRIAL SAFETY - unit notes.pptx
OME754 – INDUSTRIAL SAFETY - unit notes.pptxOME754 – INDUSTRIAL SAFETY - unit notes.pptx
OME754 – INDUSTRIAL SAFETY - unit notes.pptx
shanmugamram247
 
ANATOMY OF SOA - Thomas Erl - Service Oriented Architecture
ANATOMY OF SOA - Thomas Erl - Service Oriented ArchitectureANATOMY OF SOA - Thomas Erl - Service Oriented Architecture
ANATOMY OF SOA - Thomas Erl - Service Oriented Architecture
Divya Rajasekar
 
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in CityGirls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
rawankhanlove256
 
Adv. Digital Signal Processing LAB MANUAL.pdf
Adv. Digital Signal Processing LAB MANUAL.pdfAdv. Digital Signal Processing LAB MANUAL.pdf
Adv. Digital Signal Processing LAB MANUAL.pdf
T.D. Shashikala
 
Presentation python programming vtu 6th sem
Presentation python programming vtu 6th semPresentation python programming vtu 6th sem
Presentation python programming vtu 6th sem
ssuser8f6b1d1
 
11th International Conference on Computer Science, Engineering and Informatio...
11th International Conference on Computer Science, Engineering and Informatio...11th International Conference on Computer Science, Engineering and Informatio...
11th International Conference on Computer Science, Engineering and Informatio...
ijcisjournal
 
IE-469-Lecture-Notes-3IE-469-Lecture-Notes-3.pptx
IE-469-Lecture-Notes-3IE-469-Lecture-Notes-3.pptxIE-469-Lecture-Notes-3IE-469-Lecture-Notes-3.pptx
IE-469-Lecture-Notes-3IE-469-Lecture-Notes-3.pptx
BehairyAhmed2
 
Red Hat Enterprise Linux Administration 9.0 RH124 pdf
Red Hat Enterprise Linux Administration 9.0 RH124 pdfRed Hat Enterprise Linux Administration 9.0 RH124 pdf
Red Hat Enterprise Linux Administration 9.0 RH124 pdf
mdfkobir
 
Buy a fake University of Washington diploma
Buy a fake University of Washington diplomaBuy a fake University of Washington diploma
Buy a fake University of Washington diploma
College diploma
 
readers writers Problem in operating system
readers writers Problem in operating systemreaders writers Problem in operating system
readers writers Problem in operating system
VADAPALLYPRAVEENKUMA1
 
Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 in CityGirls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 in City
sunnuchadda
 
Sustainable construction is the use of renewable and recyclable materials in ...
Sustainable construction is the use of renewable and recyclable materials in ...Sustainable construction is the use of renewable and recyclable materials in ...
Sustainable construction is the use of renewable and recyclable materials in ...
RohitGhulanavar2
 
# Smart Parking Management System.pptx using IOT
# Smart Parking Management System.pptx using IOT# Smart Parking Management System.pptx using IOT
# Smart Parking Management System.pptx using IOT
Yesh20
 
Concepts Basic/ Technical Electronic Material.pdf
Concepts Basic/ Technical Electronic Material.pdfConcepts Basic/ Technical Electronic Material.pdf
Concepts Basic/ Technical Electronic Material.pdf
OBD II
 
PPT_grt.pptx engineering criteria grt for accrediation
PPT_grt.pptx engineering criteria  grt for accrediationPPT_grt.pptx engineering criteria  grt for accrediation
PPT_grt.pptx engineering criteria grt for accrediation
SHALINIRAJAN20
 
CGR-Unit-1 Basics of Computer Graphics.pdf
CGR-Unit-1 Basics of Computer Graphics.pdfCGR-Unit-1 Basics of Computer Graphics.pdf
CGR-Unit-1 Basics of Computer Graphics.pdf
Rugved Collection
 
Traffic Engineering-MODULE-1 vtu syllabus.pptx
Traffic Engineering-MODULE-1 vtu syllabus.pptxTraffic Engineering-MODULE-1 vtu syllabus.pptx
Traffic Engineering-MODULE-1 vtu syllabus.pptx
mailmad391
 
SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...
SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...
SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...
Jim Mimlitz, P.E.
 
How to Formulate A Good Research Question
How to Formulate A  Good Research QuestionHow to Formulate A  Good Research Question
How to Formulate A Good Research Question
rkpv2002
 

Recently uploaded (20)

API-1150WB-Cooling Towers.pdf with details
API-1150WB-Cooling Towers.pdf with detailsAPI-1150WB-Cooling Towers.pdf with details
API-1150WB-Cooling Towers.pdf with details
 
OME754 – INDUSTRIAL SAFETY - unit notes.pptx
OME754 – INDUSTRIAL SAFETY - unit notes.pptxOME754 – INDUSTRIAL SAFETY - unit notes.pptx
OME754 – INDUSTRIAL SAFETY - unit notes.pptx
 
ANATOMY OF SOA - Thomas Erl - Service Oriented Architecture
ANATOMY OF SOA - Thomas Erl - Service Oriented ArchitectureANATOMY OF SOA - Thomas Erl - Service Oriented Architecture
ANATOMY OF SOA - Thomas Erl - Service Oriented Architecture
 
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in CityGirls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Mysore 000XX00000 Provide Best And Top Girl Service And No1 in City
 
Adv. Digital Signal Processing LAB MANUAL.pdf
Adv. Digital Signal Processing LAB MANUAL.pdfAdv. Digital Signal Processing LAB MANUAL.pdf
Adv. Digital Signal Processing LAB MANUAL.pdf
 
Presentation python programming vtu 6th sem
Presentation python programming vtu 6th semPresentation python programming vtu 6th sem
Presentation python programming vtu 6th sem
 
11th International Conference on Computer Science, Engineering and Informatio...
11th International Conference on Computer Science, Engineering and Informatio...11th International Conference on Computer Science, Engineering and Informatio...
11th International Conference on Computer Science, Engineering and Informatio...
 
IE-469-Lecture-Notes-3IE-469-Lecture-Notes-3.pptx
IE-469-Lecture-Notes-3IE-469-Lecture-Notes-3.pptxIE-469-Lecture-Notes-3IE-469-Lecture-Notes-3.pptx
IE-469-Lecture-Notes-3IE-469-Lecture-Notes-3.pptx
 
Red Hat Enterprise Linux Administration 9.0 RH124 pdf
Red Hat Enterprise Linux Administration 9.0 RH124 pdfRed Hat Enterprise Linux Administration 9.0 RH124 pdf
Red Hat Enterprise Linux Administration 9.0 RH124 pdf
 
Buy a fake University of Washington diploma
Buy a fake University of Washington diplomaBuy a fake University of Washington diploma
Buy a fake University of Washington diploma
 
readers writers Problem in operating system
readers writers Problem in operating systemreaders writers Problem in operating system
readers writers Problem in operating system
 
Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 in CityGirls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 in City
Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 in City
 
Sustainable construction is the use of renewable and recyclable materials in ...
Sustainable construction is the use of renewable and recyclable materials in ...Sustainable construction is the use of renewable and recyclable materials in ...
Sustainable construction is the use of renewable and recyclable materials in ...
 
# Smart Parking Management System.pptx using IOT
# Smart Parking Management System.pptx using IOT# Smart Parking Management System.pptx using IOT
# Smart Parking Management System.pptx using IOT
 
Concepts Basic/ Technical Electronic Material.pdf
Concepts Basic/ Technical Electronic Material.pdfConcepts Basic/ Technical Electronic Material.pdf
Concepts Basic/ Technical Electronic Material.pdf
 
PPT_grt.pptx engineering criteria grt for accrediation
PPT_grt.pptx engineering criteria  grt for accrediationPPT_grt.pptx engineering criteria  grt for accrediation
PPT_grt.pptx engineering criteria grt for accrediation
 
CGR-Unit-1 Basics of Computer Graphics.pdf
CGR-Unit-1 Basics of Computer Graphics.pdfCGR-Unit-1 Basics of Computer Graphics.pdf
CGR-Unit-1 Basics of Computer Graphics.pdf
 
Traffic Engineering-MODULE-1 vtu syllabus.pptx
Traffic Engineering-MODULE-1 vtu syllabus.pptxTraffic Engineering-MODULE-1 vtu syllabus.pptx
Traffic Engineering-MODULE-1 vtu syllabus.pptx
 
SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...
SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...
SCADAmetrics Instrumentation for Sensus Water Meters - Core and Main Training...
 
How to Formulate A Good Research Question
How to Formulate A  Good Research QuestionHow to Formulate A  Good Research Question
How to Formulate A Good Research Question
 

Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024

  • 1. Optimizing Gradle Builds Strategies to Identify, Resolve, and Avoid Cache Issues Sinan Kozak
  • 2. Sinan Kozak Google Developer Expert Staff Android Developer @DeliveryHero
  • 3. Fast CI results? Quick local builds? CI/CD is mostly more centralized in Delivery Hero. Bigger customer team has splitted infra teams per topic, but Logistics Tribe has one Mobile Infra. Practical optimizations with tradeoffs are very critical.
  • 4. Cycle time increase incident - March 24
  • 5. 90+ minutes Long PR checks are unacceptable
  • 6. What does bad look like?
  • 7. How did it start? Initial usage Full migration Convention plugin and more tests
  • 8. CI cost and Cycle time had skyrocketed
  • 9. Why didn’t we notice earlier? We had other planned changes that increased CI time. ● Running lint on test code ● Detect verification per commit
  • 10. Build Benchmark We use Gradle Profiler on CI to compare times ● Incremental build for ABI and non-ABI changes in critical modules ● Gradle Enterprise scan comparison We didn’t have profiling for; ● Unit test compile ● Android test compile
  • 11. Impact analysis Problem grow with number of feature with screenshot test ● Convention plugin and training increased the speed ● 60+ of 450 modules has screenshot tests now
  • 12. PR Check CI steps ● Checkout ● Setup ● Lint + Detect ● Unit Test ○ testDebugUnitTest ● Screenshot test ○ verifyPaparazziDebug ● Coverage ○ JoCoCo + dependOn(Test Tasks)
  • 13. Why does Gradle disable cache for test task?
  • 14. Where are details? What is output $2 -Dorg.gradle.caching.debug=true
  • 15. Let’s investigate Paparazzi suppose to be fast and run on JVM like any other junit test. ● Yes, it is faster to run. ● Yes, it runs on JVM. We don’t need emulator ● But, but, but… Paparazzi Gradle Plugin configures the Test task even for non Paparazzi tests!!
  • 18. What would be nice setup? ● Verify screenshot tests by default ○ Create aggregated report on demand ○ Fail unit test when screenshot test fail ● Make screenshots folder input of tasks for verification case ○ Screenshots are input of verification ● Remove reports path as output. Html report aggregates with every run. ○ Reports are not reproducible. ● Record task is never up to date when we run record
  • 21. 90m -> 35m ~60% improvement after changing a Paparazzi Plugin setup.
  • 22. Don’t modify cacheability of other tasks
  • 23. But our devs never use the report
  • 24. What will we work on next? More benchmark cases on CI with Gradle Profile ● Unit test and Android Test builds Make profiling automatic and blocker for certain type of PRs ● Dependency changes Maintain internal Paparazzi plugin unless they change the defaults https://github.com/cashapp/paparazzi/issues/1334 https://github.com/cashapp/paparazzi/issues/1365 Gist of modified Paparazzi Plugin https://gist.github.com/kozaxinan/4b44f817b28ac409f950c041c3627eca