performance testing on android
TRANSCRIPT
Android: Performance Testing-Akshay Dashrath
Need Speed?
What about?
Tools
• Analysing logs (Trace View)• Heap Dump Analysis• Debug class
Trace View
• Graphical Tool to analyse execution logs
• // start tracing to "/sdcard/test.trace"
Debug.startMethodTracing(“test"); // ... // stop tracing
Debug.stopMethodTracing();• adb pull /sdcard/test.trace C:/• traceview C:/trace.test
Issues
• If a thread exits during profiling, the thread name is not emitted;
• The VM reuses thread IDs. If a thread stops and another starts, they may get the same ID.
• .trace files larger than 8MB cannot be read by the Viewer
Instruction Count
Instructions Executed Method Invocations0
200000
400000
600000
800000
1000000
1200000
1400000
1600000
1800000
349 55
1584331
280490
1570294
160061
Heap Dumps
• C:/adb shell• C:/ chmod 777 /data/misc – In order to make the /data/misc
directory writeable• C:/exit• C:/ adb shell ps• C:/ adb shell kill -10 1234 -------Example• C:/ adb pull /data/misc/heap-dump-tm-pid.hprof
address.hprof• C:/ hprof-conv heap-dump-tm-pid.hprof 4mat.hprof
Questions?