Discussions of mobile performance tend to focus on optimizing for different devices, browsers, operating systems, and carriers. These are important topics, but what if you looked at performance from an end-user perspective? Users care about things like mobile app download time, page load speed, image quality, flow of actions, security, and overall user experience.
For your mobile app to succeed, you need to consider both the view of your application from the perspective of the end user (front end) and the factors that affect performance at the back end and in turn influence the end-user experience. Some examples of performance-related metrics you should use on the front end include:
- Application response time
- Screen rendering times
- Memory, battery, and data plan usage
- App crashes
Examples of back-end performance metrics include:
- Server response time
- Time to first byte
- Number of HTTP calls
- TCP connection times
Let's take a closer look at the metrics and see how they affect application performance.
Front-end performance metrics
How users experience your app is going to have an enormous effect on its ultimate success or failure. You need to find ways to understand how the app is perceived out in the real world. Here are some metrics that can help you understand how users perceive your app:
Application response time
Users have little patience for slow apps. Acceptable mobile response times tend to be in the two-to-three-second range. If your mobile app does not perform to this level, users will simply move on to something that does, leaving your products and services behind.
There are several things you can do to optimize your mobile app performance. Examples include:
- Having fewer unique objects on the page so your app makes fewer HTTP requests
- Having fewer URL redirects
- Removing components like Flash
- Reducing cookie size
When building an application, consider different types of responses: How long does it take for your application to load, serve up images, or respond to the user's input? Do these response times vary depending on how or where your mobile app is used?
Also consider how much of the data (and time) is traversing the network via request and reply messages. What impact does that have on mobile app performance?
Screen rendering
It's not good enough to have great response times if your mobile app does not render well. Content, images, and animations developed on or for desktop screens do not render well on mobile screens. Ask yourself:
- What is the mean time to rendering?
- How well does your application render in different screen sizes and different operating system environments?
- How well adjusted are the dimensions of a web page to the width of the mobile device screen?
- Are font sizes consistent?
- Do your users have to zoom in or zoom out to read content and interact with your application?
- Are images scaled down properly to match how they will be displayed on the mobile device?
Avoiding CSS expressions can help improve screen-rendering times by limiting the frequent evaluations that are otherwise involved each time a page is resized or scrolled or when the user manipulates the screen. Similarly, referencing images in HTML instead of CSS can speed up rendering times on your mobile app.
Is your mobile application a resource hog?
Users tend to dislike mobile applications that consume resources such as CPU, memory, and battery. Mobile devices are much more powerful than they were a few years ago. Even so, they have somewhat constrained resources compared to desktop devices. If your mobile app consumes a lot of CPU, drains battery power, or is very chatty; chances are that users will simply jettison your app or stop using it altogether.
App crashes
I cannot think of a time when an app crash is acceptable, nor can I imagine a business embracing a failure rate as acceptable. An app crash is the ultimate front-end performance failure, especially for end users in the wild utilizing your products and services.
How often does your application crash? What percentage of your users has suffered a crash? How often does your application hang or encounter a failed network request?
Back-end performance metrics
Keeping the front-end experience in mind is critical when developing mobile applications. But there are plenty of things that go on at the back end that are equally important. In fact, a lot of the user experience at the front end has a direct cause-and-effect relationship to what happens at the back end, and vice versa. Consider some of the following examples:
Server response time
Your mobile app might be well designed for look and feel and usability, but how does your mobile app impact the back-end infrastructure supporting your app? If the back-end server response time is slow, your app will be slow.
Several factors can contribute to slow server response times, including a lack of server resources, overloaded servers, memory leaks that impact the memory on the server, and the speed of the network connection that your end users are using your mobile app.
Time to first byte
One good indicator of server response time is the time to first byte. TTFB basically measures the time from when a user first initiates a web request to when the first byte of the requested data appears on the end user's device. Keeping an eye on such issues is critical to ensuring that application response times match users' expectations.
You can measure TTFB by determining when the first byte clears your firewall, but for true metrics, you should emulate end-user devices.
HTTP calls
The more requests that your application makes with a back-end server in order to complete a user request, the more the opportunities for your app to slow down or crash. So reducing the number of calls or requests that your application makes with back-end servers and services when a user interacts with your application is one way to improve server response times.
Developers can take other steps as well. For example, avoiding empty SRC or HREF tags eliminates the need for the server to waste computing cycles on pages that will not be viewed. Avoiding HTTP 404 errors and the use of cookies for static components are other ways of ensuring that server resources are not wasted.
Where cookies are needed for authentication and personalization purposes, it is best to keep them small to minimize impact on server response times.
DNS lookups
DNS lookups take a lot longer to perform on a mobile network than on a traditional wired network and contribute significantly to application performance issues. A DNS lookup for an IP address on a mobile network takes between 120 and 400 or more milliseconds, a period during which the browser cannot download anything else.
A single mobile DNS lookup can have the same effect as downloading multiple object requests. So reducing DNS lookups can boost application performance.
Connection times
Wireless and mobile networks have significantly less bandwidth, more latency, more packet loss, and more jitter than their wired counterparts, so it is more important to manage the connections that your apps make to the back end and capacity.
Opening up too many connections in a mobile app can create serious resource management issues. It is better to make fewer TCP connections but keep them open longer to reduce traffic and the time it takes to establish new connections.
How are you optimizing mobile app performance?
When it comes to optimizing web application performance, it is important to gather both front- and back-end metrics. Client-side measures are vital to understanding the front-end user experience. But for every end-user measure, there are several other factors on the back end that matter at least as much.
There is also a correlation between front- and back-end performance metrics, which we have not had a chance to cover in this article. As you continue down this path, this is something for you to learn about your specific mobile app and infrastructure environment.
What are you doing in terms of mobile application performance monitoring? What sorts of measures are you using to improve the end-user experience and for optimizing the back-end performance of your mobile applications?
Keep learning
Take a deep dive into the state of quality with TechBeacon's Guide. Plus: Download the free World Quality Report 2022-23.
Put performance engineering into practice with these top 10 performance engineering techniques that work.
Find to tools you need with TechBeacon's Buyer's Guide for Selecting Software Test Automation Tools.
Discover best practices for reducing software defects with TechBeacon's Guide.
- Take your testing career to the next level. TechBeacon's Careers Topic Center provides expert advice to prepare you for your next move.