When it comes to mobile application performance testing, the first things that come to mind are: startup time, response time, CPU, memory, battery, etc. We can classify these metrics into two broad categories, based on resource consumption and response time.

Resource consumption: CPU, memory, power;

Response time: startup time, response time;

From a user perspective, application performance is the response time of an application to user actions. Long response times mean not only waiting, but also poor user experience, which is directly related to the user’s intuitive experience.

What is the response time?

Response time: refers to the time between the user sending a request and receiving a response.

In layman’s terms, when a user clicks a button, issues a command or clicks a link on the application interface, the time consumed in the process from the beginning of the user’s operation to the result of the application presented in a way that the user can perceive is the application response time intuitively felt by the user.

Application response time is too long or no response is the phenomenon that users do not want to see in the process of application use, and it is also the most annoying and annoying place for users.

The diagram below:

How do you feel when you see the picture above?

In fact, a response time of more than three seconds in the middle of a large number of processes responding can seriously affect user productivity. If users take too long to respond or don’t respond while using the app, developers will be bombarded with complaints and phone calls.

How to test application response time?

We see that response time has both an objective and a subjective component for users. When the response time of the application is too long, the subjective feeling of the user will be the main reason to judge the response time of the application. Since response time is so important to the user experience, how do we test for application response time?

Test environment:

Hardware environment: Pixel 4GB RAM+32GB ROM

Software version: Android 9.0

Prerequisite: Select the same network environment for the first application installation, and select all application permissions in system Settings.

Test times: 5 times average value

Test scope:

Top information applications: Zhihu, Baidu Post Bar, Douban, Tianya

Test method:

Test steps:

  • ① Click the app icon to enter the home page and wait for the contents of the home page to be fully displayed;
  • ② Click the article search option, search for unified hot keywords, and wait for the article list page to load.
  • ③ Click any article on the article list page and record the startTime;
  • ④ Wait for the page content to be displayed completely, and record the endTime of application page loading;
  • ⑤ Repeat steps ③ and ④ for 5 times and take the average value.

Test result: Page response time = endtime-startTime

Data error: 1~2ms

Here’s an example:

Taking the response time of the article page of Zhihu APP as an example, I will demonstrate the above test steps. The hardware device uses a Pixel phone, the software needs a screen recording software, and the computer needs a player that can display the number of video frames.

First, install Zhihu APP to Pixel phone, check all permissions of Zhihu APP in system Settings, open screen recording software and start screen recording.

Open Zhihu APP, load the home page, search the keyword “Shouguang” according to recent hot news, and wait for the article list to complete loading;

Select any article, count the operation start time and page load time.

After obtaining startTime and endTime, we need to know the setting of video recording frame rate and convert frame rate unit (FPS) to time unit (ms), so that we can complete the response time calculation of zhihu APP content page.

Three, response time test results display

One second (s) is equal to 1000 milliseconds (ms). Important things say three times, 1s=1000ms! 1 s = 1000 ms! 1 s = 1000 ms! All right, remember that and then we’ll get started!

1. The response time test data of information application pages are as follows:

As mentioned above, the scope of this test is mainly information applications. The response time of the content page is most relevant to the user, considering that the most common activity that users do in their daily lives through these applications is reading. In order to reflect the practical performance of the application itself, in the selection of five test data, we respectively focused on the response time of each application content page, and finally calculated the average response time of the content page of the above several information applications by means of average.

2. Horizontal comparison of average page response time among information applications

According to the test data, baidu Tieba has the fastest average response time of 1157ms, or about 1.2s. The app with the slowest average response time for content pages is Tianya, with an average response time of 2397ms, or about 2.4s. Baidu’s Tieba is about 1.2 seconds faster than tianya’s average response time on content pages. What does 1.2 seconds mean?

First of all, let me confess that the popular science of converting time units above is purposeful. Because in everyday life, we have a much more intuitive sense of the second than the millisecond.

To give you an idea, the average person reads 300 to 500 words per minute, which equates to an average of 5 to 8 words per second. This means that users have already read five characters on the content page of Baidu Tieba, while tianya’s content page has not been fully loaded.

3. Comparison of the average page response time of each version of Tianya community

The shortest average response time of tianya 6.9.0 content page is 2278ms, about 2.3s, and the longest average response time of Tianya 6.8.0 content page is 2559ms, about 2.6s. It can be seen that tianya community in the application version update process, the overall page response time shows a trend of shortening, page response speed has been continuously optimized and improved.

In the statistical process of response time of 5 content pages of Tianya community version 6.9.2, we found that the response time of 5 content pages was above 2000ms (2s). As we know, the longest waiting time of nearly half of users is 3 seconds in the process of waiting for the page to load. Although the overall page response time of Tianya community is less than 3 seconds, the page response speed should be further improved and the page response time should be shortened in the process of providing better reading experience for users.

4. Causes of long page response time

1, the page is complex, need to draw too much content (layout & controls), resulting in page loading time is too long.

2. The page is excessively drawn, resulting in a long drawing time.

3. DOM structure is complex.

4. Excessive or inappropriate DOM manipulation.

5. Too many HTTP requests, too long request time, abnormal request (interrupt, no response, request error) and other situations.

Five, optimization suggestions:

1. Reduce the complexity of view.ondraw ().

2. Avoid overdrawing.

3. Avoid overly complex DOM structures and excessive nesting.

4, ensure concise, clear HTML structure, reduce or avoid redundant HTML tags.

5, make good use of the cache, only load the initialized or updated state of the resource, to the resource no update will return the cached results.

At present, Huawei Terminal Open Lab has launched the application page response time test function, welcome all application developers to come to use!

① Log in to DevEco platform

Go to https://deveco.huawei.com/ and login to your account and choose “test services – clouds testing, performance testing”

② Select the model and click “Experience now”

③ Upload the application APK as required to obtain the test results of page response time.

Huawei Terminal Open Lab will continue to release evaluation reports of various applications in the future, providing users with reference to select the best application experience. Please pay attention!

If you have better solutions and insights, feel free to leave a comment below.

If you have any questions, email [email protected].

Follow the Android Green Alliance public account to learn more