android performance profiling concepts and tools...android performance profiling concepts and tools...

14
Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014

Upload: others

Post on 23-Jun-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Android Performance Profiling Concepts and Tools...Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014 ... •

Android Performance Profiling Concepts and Tools

Karthik Hariharakrishnan Founder - GameBench

Multicore Challenge - 2014

Page 2: Android Performance Profiling Concepts and Tools...Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014 ... •

Creators of the first ‘Usability’ testing infrastructure.

We objectively quantify ‘Usability’ (scores) of a device

Provide easy to use tools for visual analysis & optimization

Publish consumer data and rate devices

Who are we

Page 3: Android Performance Profiling Concepts and Tools...Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014 ... •

Agenda

Performance profiling - Android • What does it mean?

App/Games Developer • How do I measure performance? • How do I measure system utilization? • What are the possible bottlenecks? • How do I detect them?

Challenges in Android • Optimizing for several 1000 devices

Page 4: Android Performance Profiling Concepts and Tools...Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014 ... •

Performance Profiling

App Developer

• Fast Loading • Silky Smooth Transitions • Optimized memory usage • No stutters • Low Battery Usage

Game Developer • Consistent framerate • No stutters • Low battery usage

Page 5: Android Performance Profiling Concepts and Tools...Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014 ... •

Memory

Memory Usage • How much memory does my app consume? • Will my app be killed? • How do I measure?

Dalvik • Memory allocated by Java

Native • Memory allocated by native code (C/C++)

Other • Memory allocated by other frameworks

Page 6: Android Performance Profiling Concepts and Tools...Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014 ... •

Measure Memory

Interpreting log messages - Logcat • Printed during GC (Garbage Collection)

View Heap updates - DDMS • View app heap • Force GC and look at memory cleared

Track allocations - DDMS • Track allocations when interacting with App • Identify (un-necessary)memory allocations

Heap Dump Dump entire app heap and analyse references kept

Page 7: Android Performance Profiling Concepts and Tools...Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014 ... •

Tracking Allocations

Page 8: Android Performance Profiling Concepts and Tools...Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014 ... •

Performance

Frames per second (FPS) • Time taken to draw one frame • Modern devices have 60 Hz display • 16 ms to draw one frame

Stutters • Dropping a frame suddenly • Eg - Sequence of frames 16 – 16 – 32 – 16 - 16

Measure • Using getTimeOfDay • adb shell dumpsys gfxinfo <app>

• Gives the timestamps of last n frames • Use vendor specific tools

Page 9: Android Performance Profiling Concepts and Tools...Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014 ... •

Battery Consumption

Is my app a battery killer? • Measure battery usage during a 10 min run • Use Android Battery API’s

What is the apps resource utilization? • What is the CPU Clocked at? • What is the GPU clocked at? • Am I effectively threaded?

Page 10: Android Performance Profiling Concepts and Tools...Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014 ... •

CPU Usage

What is my app’s CPU consumption • Android reports aggregate usage in multi-core systems • Invariant to CPU Clocking governors • Measure using /proc/stat and /proc/{pid}/stat

How do my threads behave? • Measure using /proc/ filesystem

How are the different CPU Cores clocked?

• Linux kernel uses CPU Freq • Various “sysfs” points that can be used to measure CPU Core behavior

Page 11: Android Performance Profiling Concepts and Tools...Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014 ... •

GPU Usage – Games Only

What is my app’s GPU Utilization? • No standard • Various GPU Vendors (ARM, IMG, Qcom, Nvidia etc)

Is my game – • CPU Bound ? • GPU Bound (Vertex / Fragment) ? • Bandwidth Bound ?

Vendor Tools

• Mali Streamline

• Nvidia Perf Hud ES • Adreno Profiler • PVR Scope

Page 12: Android Performance Profiling Concepts and Tools...Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014 ... •

Android Fragmentation

How do I test for > 10 devices • Atleast 4000 unique Android devices • 200 – 300 popular ones

Solution • Upload application to testing cloud • Run tests on many devices at once

Page 13: Android Performance Profiling Concepts and Tools...Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014 ... •

Unified dashboard for all data analysis

Precise analysis of individual sessions, but also the averaging out of hundreds of sessions, to get an unparalleled overview of the ecosystem

Data metrics pushed to a sophisticated web dashboard for in-depth visualizations

Dev 1 Dev 2 Dev 3 Dev 4 Dev 5 Dev 6

Page 14: Android Performance Profiling Concepts and Tools...Android Performance Profiling Concepts and Tools Karthik Hariharakrishnan Founder - GameBench Multicore Challenge - 2014 ... •

Questions