← All Posts

Just because your site isn't for emerging markets, doesn't excuse you from web performance optimisation

Crowded New Delhi Street
Credit: Igor Ovsyannykov

When it comes to justifying the value of web performance, you may have come across the phrase "The Next Billion Users". These are people living in emerging markets who are not currently online but will be over the coming years. As they join the web, many will have their experience hampered by the limited processing power of budget mobile devices and poor network connectivity – so this (I hope!) makes it an obvious business reason to invest in optimising performance and unlock the immense potential value in these markets.

However, for some companies, it's easy to dismiss this reason with the excuse that their business only sells to wealthy western markets.

Ignoring the fact that, even within developed countries, you will still have a wide range of affluence, rural areas with poor connectivity and people who do not care about or require the latest, greatest technology – you simply cannot trust the network, nor can you trust devices.

You cannot trust the (4G / WiFi) network

Last October, I was sat using my mobile to catch-up on some email and even with three-out-of-four bars of 4G, page loads were ~60 seconds! Note: this was on an iPhone 7+!

Note: I'm not calling out The New Stack in the video above, this was one of many sites I tried.

Just because there's a strong wireless signal between a device and it's gateway, whether that's a cell tower or WiFi router, doesn't mean the backing hard-wired network isn't congested – I'm sure anyone who has attempted to use WiFi on a British train can relate!

It only takes a quick search of Twitter for "slow 4g" or "slow wifi" to see hundreds of people dealing with these scenarios.

"The network is reliable" is literally #1 of the Fallacies of Distributed Computing, it would be wise for us not to forget this.

You cannot trust devices

As 2017 was coming to a close, a controversial hidden 'feature' in iOS was discovered: Apple is throttling the CPU of iPhones to maintain battery life as they naturally degrade through use. I feel they had the best intentions with this, but it was invisible to the user, so they may be unaware that this throttling is occurring and blame individual websites for being slow.

Fast forward a mere month and the Spectre attack affects ARM, Intel and AMD CPUs, causing upto 20% degradation in processing power. After the iOS patch, Melvin Mughal's benchmarks on an iPhone 6 showed a 36-56% degradation in web-related tests, looking at the HTML5 Parse / DOM benchmarks, edit: unfortunately he's since taken the post content down due to personal attacks 😞 – if anyone has a source of web-specific benchmarks, please let me know.

These benchmarks may not perfectly represent real usage, but it's not looking good!

As if this situation isn't bad enough, there's another factor that is rarely considered: input lag. On top of variable CPU performance, we have to cater for hundreds of milliseconds of latency on interactions.

Device input latency – source: Dan Luu's post on 'Input Lag'
Device Latency (ms) Year
iPad Pro 10.5" pencil 30 2017
iPad Pro 10.5" 70 2017
iPhone 4S 70 2011
iPhone 6S 70 2015
iPhone 3GS 70 2009
iPhone X 80 2017
iPhone 8 80 2017
iPhone 7 80 2016
iPhone 6 80 2014
iPhone 5 90 2012
Blackberry Q10 100 2013
Huawei Honor 8 110 2016
Google Pixel 2 XL 110 2017
Galaxy S7 120 2016
Galaxy Note 3 120 2016
Moto X 120 2013
Nexus 5X 120 2015
OnePlus 3T 130 2016
Blackberry Key One 130 2017
Moto E (2g) 140 2015
Moto G4 Play 140 2017
Moto G4 Plus 140 2016
Google Pixel 140 2016

You'd expect devices to be improving over time, but they're not! The Pixel 2 XL, Google's flagship smartphone for 2017, is way up at 110ms and the iPhone X is 10ms worse than the archaic 3GS.

Even with the fastest devices, this doesn't give us a lot of time for executing JavaScript for things to feel instant (the accepted threshold being 100ms).

Finally, you might have noticed when you get to low battery, devices typically offer to enter 'low power mode' - this is a great feature, but will worsen CPU performance.

Low-power mode

The Apple iPhone X has 6 CPU cores, 2 high-power and 4 'efficiency', and whilst I'm sure Apple has complex algorithms for this, you can bet that the high-power cores are avoided or even completely disabled in low power mode.

With the ever-increasing volume of JavaScript used on sites, you could have users on high-end smartphones or even desktops, no older than a couple of years, receiving a less-than-optimal experience - nobody is safe from this.

A vast portion of time is consumed parsing, compiling and executing JavaScript. The diagram below from Addy Osmani illustrates this well:

Source: The Cost of JavaScript

No more excuses

Poor device/network performance is indiscriminate: no matter the audience – web performance matters.

Some people certainly have it far worse than others, but any company making money on the web, regardless of the affluence of their users, has a responsibility to optimise their sites - the variability of the environment sites are accessed from might surprise you.

The wonderful thing about optimising sites is everyone benefits, no matter the device, network or environment.

Photo of Ryan

Hi, I'm Ryan.

I have been working with the web for 15 years, and I'm currently CTO of Shift Commerce, a SaaS ecommerce platform bringing agility to mid-to-enterprise businesses.

Running a conference? I'd love to speak — see my speaking page for more.