Slide 1

Slide 1 text

ART of Q 2019-05-21 (mixi & CA).aab Hiroshi Kurokawa

Slide 2

Slide 2 text

Understanding Android Runtime (ART) for Faster Apps https://www.youtube.com/watch?v=1uLzSXWWfDg

Slide 3

Slide 3 text

Improvements in ART • App Startup Time • Garbage Collection

Slide 4

Slide 4 text

Improvements in ART • App Startup Time • Garbage Collection

Slide 5

Slide 5 text

Cloud profiles https://youtu.be/1uLzSXWWfDg?t=210

Slide 6

Slide 6 text

Application images https://youtu.be/1uLzSXWWfDg?t=368

Slide 7

Slide 7 text

Application images https://youtu.be/1uLzSXWWfDg?t=440

Slide 8

Slide 8 text

Unspecialized app process pool System Server Zygote App Process Fork

Slide 9

Slide 9 text

Unspecialized app process pool System Server Unspecialized App Process

Slide 10

Slide 10 text

Analyzing startup time • StartupAnalyzerKt
 https://android.googlesource.com/platform/tools/ trebuchet/ • Use Activity#reportFullyDrawn()
 https://developer.android.com/reference/android/app/ Activity#reportFullyDrawn()

Slide 11

Slide 11 text

Improvements in ART • App Startup Time • Garbage Collection

Slide 12

Slide 12 text

Generational Concurrent Compaction

Slide 13

Slide 13 text

CC Root reachable unreachable

Slide 14

Slide 14 text

CC Root To Space Evacuated Region

Slide 15

Slide 15 text

Generational CC Younger Generation Older Generation Full-heap
 GC Young-gen GC

Slide 16

Slide 16 text

Generational CC Younger Generation Older Generation

Slide 17

Slide 17 text

2-phase collection

Slide 18

Slide 18 text

2-phase collection • For full-heap GC • Trace live objects and compute liveness stat • Evacuate regions based on up-to-date stats

Slide 19

Slide 19 text

Object pooling • In most cases, it doesn’t make sense • Even if you are sure it improves the performance, it would be better to measure the performance

Slide 20

Slide 20 text

Reference https://youtu.be/Zc4JP8kNGmQ