55
The Art of Mobile App Performance

The Art of Mobile Performance (Mobiconf 2015)

Embed Size (px)

Citation preview

Page 1: The Art of Mobile Performance (Mobiconf 2015)

The Art of Mobile App Performance

Page 2: The Art of Mobile Performance (Mobiconf 2015)

@

David Low – Skyscanner Developer Advocate

www.skyscanner.net

[email protected]

daviddlow

Page 3: The Art of Mobile Performance (Mobiconf 2015)

Introduction

Page 4: The Art of Mobile Performance (Mobiconf 2015)

About Skyscanner

Page 5: The Art of Mobile Performance (Mobiconf 2015)

App performance

Page 6: The Art of Mobile Performance (Mobiconf 2015)

App performance

Are you doing the right thing?

Page 7: The Art of Mobile Performance (Mobiconf 2015)

What is Mobile?

Mobile phone?

Page 8: The Art of Mobile Performance (Mobiconf 2015)

What is Mobile?

Laptop with poor connection?

Page 9: The Art of Mobile Performance (Mobiconf 2015)

What is Mobile?

Newspaper guy?

Page 10: The Art of Mobile Performance (Mobiconf 2015)

What’s in a phone?

Page 11: The Art of Mobile Performance (Mobiconf 2015)

Apps and Web

Page 12: The Art of Mobile Performance (Mobiconf 2015)

Context

Page 13: The Art of Mobile Performance (Mobiconf 2015)

The Mobile Mind Shift

“The expectation that I can get what I want in my immediate context in my moment of need’."

Page 14: The Art of Mobile Performance (Mobiconf 2015)

Degrade to Desktop

Page 15: The Art of Mobile Performance (Mobiconf 2015)

Are you still doing the right thing?

Decision time – build an app?

Page 16: The Art of Mobile Performance (Mobiconf 2015)

Lean on the platform

Platforms and OSsProvides guidelines and expectations

Standard ComponentsAlready provide useful, tested ways to do

things (eg. cocoapods)

Your specific use casesBuild only the minimum pieces you need to hit that platform in the most useful way

Wider InternetStandards, communities, open source

Page 17: The Art of Mobile Performance (Mobiconf 2015)

Think small

Page 18: The Art of Mobile Performance (Mobiconf 2015)

Apps within apps?

The shifting market

Page 19: The Art of Mobile Performance (Mobiconf 2015)

The shifting market

Thick and thin versions of products

Page 20: The Art of Mobile Performance (Mobiconf 2015)

Architecture

The four-tier engagement platform

With thanks to Forrester Research

Application deliveryOptimisation, caching, personalisation

Data sourcesMany and varied, internal, external,

social, real-time

Data transformationAggregation and translation of many data sources

ClientsMany of them – mobile, IoT, desktopRendered to suit

Page 21: The Art of Mobile Performance (Mobiconf 2015)

A world of possibilities

Page 22: The Art of Mobile Performance (Mobiconf 2015)

One last thing…

Page 23: The Art of Mobile Performance (Mobiconf 2015)

Do people understand your app?

Page 24: The Art of Mobile Performance (Mobiconf 2015)

Pictures tell many words

Page 25: The Art of Mobile Performance (Mobiconf 2015)

Pictures tell many words

Page 26: The Art of Mobile Performance (Mobiconf 2015)

Pictures tell many words

Page 27: The Art of Mobile Performance (Mobiconf 2015)

Pictures tell many words

Page 28: The Art of Mobile Performance (Mobiconf 2015)

Pictures tell many words

Page 29: The Art of Mobile Performance (Mobiconf 2015)

Ratings and reviews

Page 30: The Art of Mobile Performance (Mobiconf 2015)

Customer support in public

Page 31: The Art of Mobile Performance (Mobiconf 2015)

What can we measure?

There are a number of layers that performance can be measured at.

Hardware

Page 32: The Art of Mobile Performance (Mobiconf 2015)

What can we measure?

There are a number of layers that performance can be measured at.

Hardware

API

Page 33: The Art of Mobile Performance (Mobiconf 2015)

What can we measure?

There are a number of layers that performance can be measured at.

Hardware

API

UI/UX

Page 34: The Art of Mobile Performance (Mobiconf 2015)

What can we measure?

There are a number of layers that performance can be measured at.

Hardware

API

UI/UX

Page 35: The Art of Mobile Performance (Mobiconf 2015)

What can we measure?

There are a number of layers that performance can be measured at.

Hardware

API

UI/UXDisplay Lag Screen Transition Times

Request/Response Latency

Resource Usage

Battery Memory CPU

Page 36: The Art of Mobile Performance (Mobiconf 2015)

Battery Usage

Battery UsageWith mobile applications it is incredibly important to be efficient in order to minimise battery usage.

Page 37: The Art of Mobile Performance (Mobiconf 2015)

Battery Usage

Battery UsageWith mobile applications it is incredibly important to be efficient in order to minimise battery usage.

Common Culprits• Screen – the phones display is turned on.• Network – using the various radios within the device to transmit and receive data.• GPS – using the receiver for accurate location identification.• Storage Access – reading and writing from storage.• Camera – use of the device’s camera

Page 38: The Art of Mobile Performance (Mobiconf 2015)

Battery Usage

Battery UsageWith mobile applications it is incredibly important to be efficient in order to minimise battery usage.

Common Culprits• Screen – the phones display is turned on. Unavoidable• Network – using the various radios within the device to transmit and receive data.• GPS – using the receiver for accurate location identification. Not necessary• Storage Access – reading and writing from storage. Low usage• Camera – use of the device’s camera. Not Used

Page 39: The Art of Mobile Performance (Mobiconf 2015)

Battery Usage

Battery UsageWith mobile applications it is incredibly important to be efficient in order to minimise battery usage.

Common Culprits• Screen – the phones display is turned on. • Network – using the various radios within the device to transmit and receive data.• GPS – using the receiver for accurate location identification. • Storage Access – reading and writing from storage. • Camera – use of the device’s camera.

Page 40: The Art of Mobile Performance (Mobiconf 2015)

Battery Usage

Battery Usage - NetworkingMinimise and Batch Network Transfer

Network communication with the API is necessary in order to populate data, where possible though the number of requests should be

minimised and performed together. Batching network transfer together will minimise the effect of ‘ramp-up’ and the ‘tail’ current levels that

occur immediately before and after transmissions.

Non-core API requests

There are a number of requests that go on in the application that are not core functionality but could be the source of increased

battery usage. Requests that send usage metrics. The requests that populate advertising slots.

We had 15 separate SDKs making separate, often duplicate calls to API services.

Page 41: The Art of Mobile Performance (Mobiconf 2015)

API Performance

API PerformanceThe speed at which the application communicates with the API impacts the perceived performance of the application greatly.

API requests should be fast, efficient and necessary.

FastThe request/response time should be minimal.

EfficientThe size of request and response payloads should be minimised.

NecessaryNetwork requests should only be performed when absolutely required.

increases speed

increases efficiency

Page 42: The Art of Mobile Performance (Mobiconf 2015)

API Performance

Measuring API performanceThere are a number of potential metrics that could be taken as an indicators of API performance.

Average Response Time

On average how long does it take for a single poll of the API

Total Response Time

For a search on the day view how long does it take to poll for all results.

Average Request Size / Average Response Size

How large are the request and response packets.

Number of requests

How many requests do we have to perform to populate the day view.

Page 43: The Art of Mobile Performance (Mobiconf 2015)

API Performance

Measuring API performanceThere are a number of potential metrics that could be taken as an indicators of API performance.

Average Response Time

On average how long does it take for a single poll of the API

Total Response Time

For a search on the day view how long does it take to poll for all results.

Average Request Size / Average Response Size

How large are the request and response packets.

Number of requests

How many requests do we have to perform to populate the day view.

} Variations by Network TypeLocationEnvironment

will increase for routes with

more providers

slower provider APIs/Scrapers

no cached results

}Wi-Fi 3G 4G GPRS EDGE

Page 44: The Art of Mobile Performance (Mobiconf 2015)

UI/UX Performance

UI/UX Performance Issues

Slow response to user input• from hitting a button to seeing results

Display rendering lag • during scrolling• while rendering screen transitions

The performance issues that reveal themselves at a UI/UX level are ultimately a reflection of how our users will perceive

application performance. As such it is vital that these issues are identified and diagnosed.

Page 45: The Art of Mobile Performance (Mobiconf 2015)

UI/UX Performance

UI ResponsivenessHow long does it take to see the results of key user journey transitions?

< 1s

< 1s

20s+ load

On the web and android we start populating each price as soon as it is received. Is this better UX?

20s+ load

Page 46: The Art of Mobile Performance (Mobiconf 2015)

UI/UX Performance

Identifying lag in the Android flights application

< 16ms and the application should render smoothly at 60 frames per second.

adb shell dumpsys gfxinfo net.skyscanner.android.main

Page 47: The Art of Mobile Performance (Mobiconf 2015)

UI/UX Performance

Let’s compare our results to another API-driven app, Spotify

Scrolling in the Spotify app browsing playlists, no noticeable lag.

adb shell dumpsys gfxinfo com.spotify.music

Page 48: The Art of Mobile Performance (Mobiconf 2015)

UI/UX Performance

One of our main competitors – little difference

adb shell dumpsys gfxinfo com.*****.android

The lag is almost identical to our own app, and possibly even worse.

Page 49: The Art of Mobile Performance (Mobiconf 2015)

Getting back to product

Page 50: The Art of Mobile Performance (Mobiconf 2015)

Picking the right measures

Page 51: The Art of Mobile Performance (Mobiconf 2015)

An example of multiple metrics

Page 52: The Art of Mobile Performance (Mobiconf 2015)

Conversion

Image: generalassembly

Page 53: The Art of Mobile Performance (Mobiconf 2015)

Sensible crash rates

iOS crash rate is usually 2% or higher

Page 54: The Art of Mobile Performance (Mobiconf 2015)

Summary

• Only build an app if you can really justify it

• Make sure you can explain very clearly what it does

• Pick your performance measurements carefully and base them on the product, not the code

• Don’t worry so much about edge cases and zero crashes – spend your time on the majority

Page 55: The Art of Mobile Performance (Mobiconf 2015)

Thank you