1 of 58

Optimising for 25,000 devices

The five stages of Android Performance grief :(

@SimonHearne ● London Web Performance ● 7/2/17

2 of 58

There were 25,000 unique

Android devices detected in 2015

3 of 58

Only 15 iPhone models have ever been produced

...

4 of 58

I’ve recognised a theme when speaking with clients

(thanks to children’s TV)

5 of 58

Denial

Bargaining

Anger

Depression

Acceptance

6 of 58

We don’t have much Smartphone traffic

7 of 58

Denial

8 of 58

Three <<large>> UK retailers.

Which is the fastest site?

9 of 58

Three large UK retailers.

Which site is faster?

Median smartphone DOM Content Loaded time

5.8s

1.8s

3.8s

10 of 58

11 of 58

Retailers with faster mobile experiences have more mobile traffic

12 of 58

Android doesn’t convert as well as iPhone

13 of 58

The Android-iOS conversion rate gap is now a mere 5%

MoovWeb - Q1 2015

14 of 58

We don’t have much Android traffic

15 of 58

53%

of mobile visits over 3 seconds are lost

https://www.doubleclickbygoogle.com/articles/mobile-speed-matters/

16 of 58

53%

of mobile visits over 3 seconds are lost

like, proper lost

https://www.doubleclickbygoogle.com/articles/mobile-speed-matters/

17 of 58

53%

of mobile visits over 3 seconds are lost

like, proper lost

not bounces, just silent echoes in an analytics void

https://www.doubleclickbygoogle.com/articles/mobile-speed-matters/

18 of 58

iOS median = 3.9s

Android median = 8.8s

19 of 58

Android users are sensitive, but forgiving

20 of 58

Bargaining

21 of 58

We’ve got an app!

22 of 58

That takes guts

23 of 58

https://medium.freecodecamp.com/all-of-2016s-top-mobile-apps-are-owned-by-either-google-or-facebook-a9c56d77a74b

24 of 58

https://medium.freecodecamp.com/all-of-2016s-top-mobile-apps-are-owned-by-either-google-or-facebook-a9c56d77a74b

25 of 58

People with cheap phones expect a slow experience

26 of 58

On mobile you are competing with the experience of native applications

27 of 58

Can we pay someone to fix this?

28 of 58

Anger

29 of 58

Why is Android so slow?!

30 of 58

31 of 58

Javascript :(

Image rendering :(

DOM creation & manipulation :(

32 of 58

Depression

33 of 58

Why did we choose Angular?

Legit stock photo

34 of 58

Optimising for everything is hard

35 of 58

36 of 58

Ethan Marcotte - Started that whole ‘Responsive Web Design’ thing

37 of 58

AMP :(

38 of 58

https://www.ampproject.org/

39 of 58

Acceptance

40 of 58

What can we do?

41 of 58

Reduce DOM complexity

42 of 58

SOASTA

43 of 58

yellowlab.tools has your back

https://github.com/gmetais/YellowLabTools/

44 of 58

Serve the right images

45 of 58

<img src="one.png"srcset="two.png 100w, three.png 500w, four.png 1000w"�� sizes="<media condition> <width>,� <media condition> <width>,� <optional default image width>">

Responsive images are simple, right?

46 of 58

<meta http-equiv="Accept-CH" content="DPR, Viewport-Width, Width">

...

<picture>

<source media="(min-width: 50em)" sizes="50vw" srcset="/image/thing">

<img sizes="100vw" src="/image/thing-crop">

</picture>

Responsive images are simple, right?

47 of 58

Serve the right images

(you don’t have to do it yourself)

48 of 58

49 of 58

Don’t enhance

(not even progressively)

50 of 58

51 of 58

The Guardian. Moto G1. 100Mb/s.

https://www.webpagetest.org/result/170207_NV_130V/

14s

52 of 58

Bite the PWA bullet

53 of 58

54 of 58

If we can do it for AMP...

https://medium.com/engineering-housing/progressing-mobile-web-fac3efb8b454

55 of 58

Device detection

at the edge!

56 of 58

Test with real devices (they’re cheap!)

Using WebPageTest. O’Reilly.

57 of 58

To get great performance on Android...

  1. Analytics is FAKE NEWS
  2. Develop a user-first strategy (whatever that means)
  3. Separate front-end from back-end
  4. Embrace the bleeding edge
  5. Use third-party services where appropriate
  6. Measure the things that matter

58 of 58

You’ve been great,

I’ve been Simon

Let’s keep in touch!

@simonhearne

simon@hearne.me

webperf.ninja