What do you do when you
have to wait 2 minutes?
Photo by NordWood Themes on Unsplash
Slide 13
Slide 13 text
Or just 20 seconds?
Photo by NordWood Themes on Unsplash
Slide 14
Slide 14 text
No content
Slide 15
Slide 15 text
Photo by Stefan Cosma on Unsplash
Slide 16
Slide 16 text
Multitasking is
killing your
brain.
Slide 17
Slide 17 text
Multitasking lets your IQ drop
significantly.
Slide 18
Slide 18 text
Like skipping whole night sleep.
Slide 19
Slide 19 text
Or smoking weed.
Image Source
Slide 20
Slide 20 text
Knowing there is an unread email
can reduce your IQ by 10 points!
Slide 21
Slide 21 text
Multitasking is especially bad for
men.
Slide 22
Slide 22 text
It can reduce the IQ up to 15
points.
Slide 23
Slide 23 text
Turning you into a cognitive
equivalent of an 8-year-old.
Slide 24
Slide 24 text
Multitasking Is Killing Your Brain
CREDIT: Getty Images
Slide 25
Slide 25 text
Slow
Builds
Test automation
is a pain.
Slow
Tests
Slide 26
Slide 26 text
Faster Builds
Slide 27
Slide 27 text
More Frequent Feedback
Faster Builds
Slide 28
Slide 28 text
Faster Development
More Frequent Feedback
Faster Builds
Slide 29
Slide 29 text
Faster Development
More Frequent Feedback
Faster Builds
Slide 30
Slide 30 text
Faster
Development
More Frequent
Feedback
Faster Builds
Slide 31
Slide 31 text
Faster
Development
More Frequent
Feedback
Faster Builds
Slide 32
Slide 32 text
Faster
Development
More Frequent
Feedback
Faster Builds
Slide 33
Slide 33 text
Faster
Development
More Frequent
Feedback
Faster Builds
Faster Builds Pyramid
Slide 34
Slide 34 text
• Measure Your Builds
• Quick Wins to Fasten Your Builds
• Modularisation and Build Speed
• Some additional information
about the topic on the chart
• Maybe some numbers or a
background information
about some insights
• Here is just another
placeholder text to visualise
the look of a filled info box
INFO BOX
Topics
Slide 35
Slide 35 text
Measure Your Builds
Photo by Annie Spratt on Unsplash
Slide 36
Slide 36 text
$ ./gradlew assembleDebug --scan
Slide 37
Slide 37 text
$ ./gradlew assembleDebug --scan
BUILD SUCCESSFUL in 1s
84 actionable tasks: 84 up-to-date
Publishing a build scan to scans.gradle.com requires
accepting the Gradle Terms of Service defined at https://
gradle.com/terms-of-service. Do you accept these terms?
[yes, no]
Slide 38
Slide 38 text
$ ./gradlew assembleDebug --scan
BUILD SUCCESSFUL in 1s
84 actionable tasks: 84 up-to-date
Publishing a build scan to scans.gradle.com requires
accepting the Gradle Terms of Service defined at https://
gradle.com/terms-of-service. Do you accept these terms?
[yes, no] yes
Slide 39
Slide 39 text
$ ./gradlew assembleDebug --scan
BUILD SUCCESSFUL in 1s
84 actionable tasks: 84 up-to-date
Publishing a build scan to scans.gradle.com requires
accepting the Gradle Terms of Service defined at https://
gradle.com/terms-of-service. Do you accept these terms?
[yes, no] yes
Gradle Terms of Service accepted.
Slide 40
Slide 40 text
$ ./gradlew assembleDebug --scan
BUILD SUCCESSFUL in 1s
84 actionable tasks: 84 up-to-date
Publishing a build scan to scans.gradle.com requires
accepting the Gradle Terms of Service defined at https://
gradle.com/terms-of-service. Do you accept these terms?
[yes, no] yes
Gradle Terms of Service accepted.
Publishing build scan...
Slide 41
Slide 41 text
$ ./gradlew assembleDebug --scan
BUILD SUCCESSFUL in 1s
84 actionable tasks: 84 up-to-date
Publishing a build scan to scans.gradle.com requires
accepting the Gradle Terms of Service defined at https://
gradle.com/terms-of-service. Do you accept these terms?
[yes, no] yes
Gradle Terms of Service accepted.
Publishing build scan...
https://gradle.com/s/glklref6wdxr6
Quick wins
1. Update your Tools
2. Use Apply Changes
3. Caching
4. Incremental Compilation
5. Parallel Builds
6. Build Variant for Develop
Photo by Richard R Schünemann on Unsplash
Optimize your build speed
https://developer.android.com/studio/build/optimize-your-build
Slide 87
Slide 87 text
19 tips for Gradle in Android
projects — 2019 Edition
https://medium.com/google-developer-experts/19-tips-for-gradle-in-android-
projects-2019-edition-11af704eb06e
Slide 88
Slide 88 text
Modularisation
Slide 89
Slide 89 text
Modules can speed up your build,
but can also slow down your build.
Slide 90
Slide 90 text
1. Build modules in parallel
Slide 91
Slide 91 text
No content
Slide 92
Slide 92 text
No content
Slide 93
Slide 93 text
No content
Slide 94
Slide 94 text
No content
Slide 95
Slide 95 text
Example
Slide 96
Slide 96 text
Small app with one module.
Slide 97
Slide 97 text
No content
Slide 98
Slide 98 text
No content
Slide 99
Slide 99 text
No content
Slide 100
Slide 100 text
Optimise
• Update gradle and gradle plugin
• Update Kotlin
• Enable parallel builds and incremental compilation
• Split up code into multiple modules
Slide 101
Slide 101 text
No content
Slide 102
Slide 102 text
Reduced build time for around
25%.
Slide 103
Slide 103 text
2. Compilation avoidance
Slide 104
Slide 104 text
No content
Slide 105
Slide 105 text
No content
Slide 106
Slide 106 text
api implementation
vs
Slide 107
Slide 107 text
api implementation
Module A
Module B
Slide 108
Slide 108 text
Module A
Module B
Module C
Foo
api
Slide 109
Slide 109 text
Module A
Module B
Module C
Foo
api
Slide 110
Slide 110 text
Module A
Module B
Module C Foo
api
Slide 111
Slide 111 text
Module A
Module B
Module C
Foo
implementation
Module A
Module B
Module C Foo
api
Slide 112
Slide 112 text
Module A
Module B
Module C
Foo
implementation
Module A
Module B
Module C Foo
api
Slide 113
Slide 113 text
Module A
Module B
Module C
implementation
Foo
Module A
Module B
Module C Foo
api
Slide 114
Slide 114 text
Module A
Module B
Module C
Foo
implementation
Module A
Module B
Module C Foo
api
Slide 115
Slide 115 text
Module A
Module B
Module C
implementation
Foo
Module A
Module B
Module C
Foo
api
Slide 116
Slide 116 text
Module A
Module B
Module C
Foo
implementation
Module A
Module B
Module C Foo
api
ModuleB is part of my
Public API
ModuleB is my
Implementation Detail
Slide 117
Slide 117 text
Module A
Module B
Module C
Foo
implementation
Module A
Module B
Module C Foo
api
ModuleB is part of my
Public API
ModuleB is my
Implementation Detail
Slide 118
Slide 118 text
Module A
Module B
Module C
Foo
implementation
Module A
Module B
Module C Foo
api
ModuleB is part of my
Public API
ModuleB is my
Implementation Detail
Slide 119
Slide 119 text
@FMuntenescu
Florina Muntenescu
Slide 120
Slide 120 text
Change
Slide 121
Slide 121 text
No content
Slide 122
Slide 122 text
No content
Slide 123
Slide 123 text
18 seconds when
in layout
Slide 124
Slide 124 text
7 seconds when
in Fragment
Slide 125
Slide 125 text
Change
Slide 126
Slide 126 text
No content
Slide 127
Slide 127 text
No content
Slide 128
Slide 128 text
18 seconds when
in layout
Slide 129
Slide 129 text
6 seconds when
in layout
Slide 130
Slide 130 text
6 seconds when in layout
3 times faster
Slide 131
Slide 131 text
7 seconds when
in Fragment
Slide 132
Slide 132 text
3 seconds when
in Fragment
Slide 133
Slide 133 text
3 seconds when in Fragment
2,3 times faster
Slide 134
Slide 134 text
Change
Run
Slide 135
Slide 135 text
65 seconds
Slide 136
Slide 136 text
Change
Run
Slide 137
Slide 137 text
Change
Run
Slide 138
Slide 138 text
65 seconds
Slide 139
Slide 139 text
9 seconds
Slide 140
Slide 140 text
9 seconds
7 times faster
Slide 141
Slide 141 text
Build just what you need
• Build only the code you want to check.
• Let you iterate faster on your feature modules.
Slide 142
Slide 142 text
3. Faster
Tests
Slide 143
Slide 143 text
Run tests
15 seconds
Slide 144
Slide 144 text
Run tests
4 seconds
Slide 145
Slide 145 text
I promised 2 seconds.
Slide 146
Slide 146 text
Plain Kotlin or Java
No Android dependencies
Slide 147
Slide 147 text
No content
Slide 148
Slide 148 text
https://medium.com/google-developer-experts/19-tips-for-gradle-in-android-projects-2019-edition-11af704eb06e
:libjava:assemble of the base java plugin
Slide 149
Slide 149 text
https://medium.com/google-developer-experts/19-tips-for-gradle-in-android-projects-2019-edition-11af704eb06e
:lib1:assembleDebug of the com.android.library
Slide 150
Slide 150 text
Create pure Java Kotlin / Libraries
Slide 151
Slide 151 text
Advantages of Multiple Modules
Slide 152
Slide 152 text
Advantages of Multiple Modules
1. Build modules in parallel
2. Compilation avoidance
3. Faster tests
4. And all the other advantages … (Reusability, Maintainability, SOLID, …)
Slide 153
Slide 153 text
Sum it up
Slide 154
Slide 154 text
Photo by Richard R Schünemann on Unsplash
Quick wins
1. Update your tools
2. Use Apply Changes
3. Use Gradle caching
4. Incremental compilation
5. Parallel builds
6. Build variant for develop
Slide 155
Slide 155 text
Create pure Java Kotlin / Libraries
Slide 156
Slide 156 text
Advantages of multiple modules
1. Build modules in parallel
2. Compilation avoidance
3. Faster tests
Slide 157
Slide 157 text
I optimise the build
speed!
Slide 158
Slide 158 text
Measure Optimise
Slide 159
Slide 159 text
Faster Builds
Slide 160
Slide 160 text
More Frequent Feedback
Faster Builds
Slide 161
Slide 161 text
Faster Development
More Frequent Feedback
Faster Builds
Slide 162
Slide 162 text
@muffls
Philipp Hofmann
Faster Development
More Frequent
Feedback
Faster Builds
Slide 163
Slide 163 text
@muffls
Philipp Hofmann
Faster
Development
More Frequent
Feedback
Faster Builds