The Art of Mobile Performance (Mobiconf 2015)

  • View
    230

  • Download
    0

  • Category

    Mobile

Preview:

Citation preview

The Art of Mobile App Performance

@

David Low – Skyscanner Developer Advocate

www.skyscanner.net

david.low@skyscanner.net

daviddlow

Introduction

About Skyscanner

App performance

App performance

Are you doing the right thing?

What is Mobile?

Mobile phone?

What is Mobile?

Laptop with poor connection?

What is Mobile?

Newspaper guy?

What’s in a phone?

Apps and Web

Context

The Mobile Mind Shift

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

Degrade to Desktop

Are you still doing the right thing?

Decision time – build an app?

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

Think small

Apps within apps?

The shifting market

The shifting market

Thick and thin versions of products

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

A world of possibilities

One last thing…

Do people understand your app?

Pictures tell many words

Pictures tell many words

Pictures tell many words

Pictures tell many words

Pictures tell many words

Ratings and reviews

Customer support in public

What can we measure?

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

Hardware

What can we measure?

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

Hardware

API

What can we measure?

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

Hardware

API

UI/UX

What can we measure?

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

Hardware

API

UI/UX

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

Battery Usage

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

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

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

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.

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.

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

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.

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

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.

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

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

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

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.

Getting back to product

Picking the right measures

An example of multiple metrics

Conversion

Image: generalassembly

Sensible crash rates

iOS crash rate is usually 2% or higher

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

Thank you

Recommended