app performance littleeyelabs

41
@littleeyelabs mobile app insights like never before Understanding the why and what of Android app performance

Upload: littleeye

Post on 22-Jun-2015

1.490 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: App performance littleeyelabs

@littleeyelabs

mobile app insights like never before

Understanding the why and what of Android app performance

Page 2: App performance littleeyelabs

@littleeyelabs

if customers uninstall, they are lost forever!

customers hate apps that drain power, crash or perform badly

“44% of users uninstall apps that perform badly”

“96% of users will give such apps a bad rating”

Source: http://apigee.com/about/pressrelease/apigee-survey-users-reveal-top-frustrations-lead-bad-mobile-app-reviews

Page 3: App performance littleeyelabs

@littleeyelabs

happens to the best of apps!

Page 4: App performance littleeyelabs

@littleeyelabs

phenomenon is not limited to consumer apps!

“if I had a penny for everytime someone complained about my app draining battery, I would be a millionaire”

- Slightly exaggerated quote of a frustrated QA manager in a large MDM company

Source: http://apigee.com/about/pressrelease/apigee-survey-users-reveal-top-frustrations-lead-bad-mobile-app-reviews

Page 5: App performance littleeyelabs

@littleeyelabs

top performance parameters

battery drain

network consumption

crashes

responsiveness

Page 6: App performance littleeyelabs

@littleeyelabs

understanding battery consumption!

Page 7: App performance littleeyelabs

@littleeyelabs

what consumespower

Page 8: App performance littleeyelabs

@littleeyelabs

networkcpudisplaygpsgpu

optimization opportunities

Page 9: App performance littleeyelabs

@littleeyelabs

EDGE slow, less power per byte of data transfer

Wifi more power, but faster

3G more power than Wifi, typically slower than Wifi.

4G more power than 3G, potentially faster than Wifi

4G > 3G > Wifi > 2G

network basics

Page 10: App performance littleeyelabs

@littleeyelabs

what causes power

consumption?

four primary states -establishmaintain (idle)transmit (two or more sub states)tail state (pseudo state)

what causes power

consumption?

Page 11: App performance littleeyelabs

@littleeyelabs

Establish Maintain Transmit Tail

Wifi High Low Low Low

2G Low Low Low Low

3G Low Low High High

what causes power

consumption?

Page 12: App performance littleeyelabs

@littleeyelabs

understanding state transitions

Page 13: App performance littleeyelabs

@littleeyelabs

prefetch databatch datadetect network stateavoid pollinguse inexact timersuse caching

tips to optimize network power

Page 14: App performance littleeyelabs

@littleeyelabs

prefetch databatch datadetect network stateavoid pollinguse inexact timersuse caching

tips to optimize network power

Page 15: App performance littleeyelabs

@littleeyelabs

prefetch databatch datadetect network stateavoid pollinguse inexact timersuse caching

tips to optimize network power

Page 16: App performance littleeyelabs

@littleeyelabs

prefetch databatch datadetect network stateavoid pollinguse inexact timersuse caching

tips to optimize network power

Page 17: App performance littleeyelabs

@littleeyelabs

prefetch databatch datadetect network stateavoid pollinguse inexact timersuse caching

tips to optimize network power

Page 18: App performance littleeyelabs

@littleeyelabs

prefetch databatch datadetect network stateavoid pollinguse inexact timersuse caching

tips to optimize network power

Page 19: App performance littleeyelabs

@littleeyelabs

varying download patternmonitor charge level and statemonitor and determine docking statemonitor connectivity stateprogrammatic control over receivers

tips to optimize network power

Page 20: App performance littleeyelabs

@littleeyelabs

varying download patternmonitor charge level and statemonitor and determine docking statemonitor connectivity stateprogrammatic control over receivers

tips to optimize network power

Page 21: App performance littleeyelabs

@littleeyelabs

varying download patternmonitor charge level and statemonitor and determine docking statemonitor connectivity stateprogrammatic control over receivers

tips to optimize network power

Page 22: App performance littleeyelabs

@littleeyelabs

varying download patternmonitor charge level and statemonitor and determine docking statemonitor connectivity stateprogrammatic control over receivers

tips to optimize network power

Page 23: App performance littleeyelabs

@littleeyelabs

varying download patternmonitor charge level and statemonitor and determine docking statemonitor connectivity stateprogrammatic control over receivers

tips to optimize network power

Page 24: App performance littleeyelabs

@littleeyelabs

CPU basics

runs on various frequencies

frequency controlled by governor policy

transitions controlled at linux layer

drops down to ‘deep sleep’ as much as it can

frequencies are scaled based of usage

Page 25: App performance littleeyelabs

@littleeyelabs

CPU spy

Page 26: App performance littleeyelabs

@littleeyelabs

monitor CPU usage

Page 27: App performance littleeyelabs

@littleeyelabs

tips to optimize cpu usage

wakelocksgreat power comes with great responsibility

be conscious about how often/long they are used

use ‘android:keepScreenOn’

spread out your computationally intensive job

Page 28: App performance littleeyelabs

@littleeyelabs

tips to optimize cpu usage

wakelocksgreat power comes with great responsibility

be conscious about how often/long they are used

use ‘android:keepScreenOn’

spread out your computationally intensive job

Page 29: App performance littleeyelabs

@littleeyelabs

tips to optimize cpu usage

gpu consumes more power than cpu

avoid floating point math where possible

use gpu for data-parallel tasks like video/image processing

use algorithms that consume less CPU cycle

O(n log n) vs O(n 2) algorithms

goal - keep the freq to the lowest level and/or reduce the number of cycles

Page 30: App performance littleeyelabs

@littleeyelabs

tips to optimize cpu usage

gpu consumes more power than cpu

avoid floating point math where possible

use gpu for data-parallel tasks like video/image processing

use algorithms that consume less CPU cycle

O(n log n) vs O(n 2) algorithms

goal - keep the freq to the lowest level and/or reduce the number of cycles

Page 31: App performance littleeyelabs

@littleeyelabs

tips to optimize cpu usage

gpu consumes more power than cpu

avoid floating point math where possible

use gpu for data-parallel tasks like video/image processing

use algorithms that consume less CPU cycle

O(n log n) vs O(n 2) algorithms

goal - keep the freq to the lowest level and/or reduce the number of cycles

Page 32: App performance littleeyelabs

@littleeyelabs

tips to optimize cpu usage

gpu consumes more power than cpu

avoid floating point math where possible

use gpu for data-parallel tasks like video/image processing

use algorithms that consume less CPU cycle

O(n log n) vs O(n 2) algorithms

goal - keep the freq to the lowest level and/or reduce the number of cycles

Page 33: App performance littleeyelabs

@littleeyelabs

screen tips color matters!esp on OLED screens

darker the color, lesser the consumption

brightness levels have more impact

programmatically reduce brightness if its suits your app/activity

Page 34: App performance littleeyelabs

@littleeyelabs

impact of display

Page 35: App performance littleeyelabs

@littleeyelabs

crashes!

Page 36: App performance littleeyelabs

@littleeyelabs

top reasons

running out of memory

hitting unexpected conditions in the app

network changes

demand exceeding expectation

responsiveness

Page 37: App performance littleeyelabs

@littleeyelabs

running out ofmemory

leaksreferences continue to exist

GC cannot collect objects, even when not used

quickly identify which use case does not reduce memory consumption

use heap dumps to drill down to actual object

continuous heap dumps and diff

Page 38: App performance littleeyelabs

@littleeyelabs

analyzing memory consumption trends

Page 39: App performance littleeyelabs

@littleeyelabs

pre & post-production analysis and monitoring

detecting performance impacts before and after release is vital

post-production tracks issues as it happens with customers

crashlytics

crittercism

pre-production analysis helps prevent issues before customers face it

Little Eye

DDMS

Page 40: App performance littleeyelabs

@littleeyelabs

demo of little eye

Page 41: App performance littleeyelabs

@littleeyelabs

“Things well done and with a care, exempt themselves from fear”

William Shakespeare

@littleeyelabs

https://angel.co/little-eye-labs

also on