Business operation and maintenance actual combat: How does Tencent optimize the APP user experience?

2022-12-31   ES  


At present, user experience has become a new product value. When technology realization is no longer the core competitiveness of the product, the competition of products is the competition of user experience. The performance experience perceived between users’ fingers is particularly important for the user experience.

Mobile Internet products Due to the problems of users’ mobile phone models, inconsistent mobile phone operating system versions, and difficult APP version, it is difficult to completely solve the performance problem of mobile APPs in development or testing. This makes mobile APP products in operation and maintenance In the process, I have to face the problem of poor user experience and poor performance.

How to make development efficiently position performance issues?

Let development, test, and clearly control the performance of each product?

We combined with the current industry commercial APM technology to realize a set of MyAPM solutions for Tencent’s operation and maintenance.

What is


APM (Application Performance Management) application performance management, it is a monitoring scheme that integrates terminals, networks, and server performance management. Here, I will not introduce it.

MyAPM, focusing on the performance management of the mobile terminal. It can monitor both positioning performance issues (slow cards), but also can be applied to daily APP performance operation analysis to improve product user experience.


MyAPM adopts a BCI injection method to realize the particle size monitoring of the business method.

When injecting technology selection, MyAPM uses an ASM injection technology. Its injection efficiency, school wrong ability, and learning cost are better than ASM.

injection phase

MyAPM realizes performance monitoring and functional development zero coupling. Inject the monitoring ability during the compilation phase to develop zero perception.

业务运维MyAPM Features:

  • Implementation Method Gravalized Automation Injecting Monitoring;
  • MyAPM uses plug -in design: each characteristic function can be freely combined to meet the customization needs of developers.

    What can I do


At present, we use MyAPM’s ability to explore and practice mainly from the following four aspects:

1. APK package size analysis

2. APP card slow monitoring analysis

3. APP startup performance analysis

4. APP core link performance analysis

1. APK package size analysis

A app, with the continuous increase of new features, its APK size is also expanding. The problem of APK SIZE is increasingly troubled and restricted to developing students, affecting the launch of certain functions, and at the same time, it also reduces the user experience.

At the same time, the longer the APP operation time, the more the number of functional iterations / code restructuring, the more the “junk” code (that is, the code that is not actually called), the more.

Due to the large number of code and the deep code calling level, each development classmate is only responsible for some functional development. If the development of the development students artificially do the global “garbage code” analysis, it is obvious that its difficulty and efficiency are not high.

and MyAPM’s APK package size analysis is used to help develop students to quickly expose these “garbage code”. Developing students only need to focus on the problem code sorted out to make further confirmation and cleanup.

1. APK package size analysis principle

  • MyAPM will inject a unique ID in the class or method;
  • Internal test environment deployment, through a large number of automated cases, filter out the call relationship code;
  • Re -inching the unclean code, the ash network, and collect the acts of real users on the line. Through the intranet test, some common code can be filtered out, thereby reducing the increase in the increase due to injecting.
  • Through the long -term, large number of users, we can position the code without actual calls. Development partners can concentrate on the confirmation and cleanup of these problems.

2, APK package size analysis application scenarios

  • Positioning is completely unlimited or cited; (thick particle size, convenient cleaning)
  • Positioning island method: that is, there is no main tone and the method of being tuned (fine particle size, comprehensive cleanup)
  • Positioning without adjustment method link;

3, APK package size analysis characteristics

  • Big data analysis of offline simulation test behavior
  • Big data analysis of actual behavior of online users
  • Performance consumption is small
  • Automatic injection

4, open source tool & apk package analysis

There may be classmates, which will list a series of open source tools, and it can also easily identify the non -adjustment code of APP. However, for a link with a calling relationship (a set of methods), it is impossible to determine whether it has been called through offline analysis. We can only use the real lines of a large number of online users to analyze to better judge and confirm.

5. Method injection sample

Report through a unique ID (14236), which not only avoids the risk of leakage of sensitive information in the code, and at the same time, it also greatly saves the amount of reporting.

6, QZONE -Android application example

qzone android app, for business code and third -party package code, use no adjustment analysis. (All variables or methods in the class are not cited or called.)

Internal testing phase:

In the internal test, due to the limited models and test cases, the analysis result is that 42%of the class is not called or referenced.

gray external network stage:

After the ash net user found that all classes were called or referenced. However, the number of 40%classes has been called less than 10 times. Because the gray degree users are 50W, that is, 40%of the code is only two thousandth of users. In response to these, we can analyze the launch loading order (such as: delay loading) of these classes.


  • The current QQ space app, there is no excess and no adjustment file.
  • follow -up, in terms of monitoring particle size, we will conduct deep -level mining analysis from the “class method”.

2. APP card slow analysis

In the APP user experience, in addition to the CRASH failure, I believe that the main thread card of the APP is slow (the thread responsible for interacting with the user), which is the most unbearable.
The slow analysis of the card here refers to the slow monitoring and analysis of the card of the main thread code of the APP.

1. Work principle

MyAPM card slow monitoring, realizing the “method particle size” in the target code and the card slow monitoring.

The essence of

is to inject time before and after the target method calls, and the card slow monitoring and analysis. The principle diagram is as follows:

2, card slow analysis full process

  • app compile, inject:Like the injecting phase of the “APK Pack Bags” above: After compiling in class, the monitoring logic injection is achieved.

    When injected, we will generate ID according to the “main method-tone method” method of the current injecting method. Similarly, it is also used for information encryption and saving reports.

  • app card slow monitoring:

    After theapp version is launched, MyAPM will monitor the target method. The online operation is time -consuming. If the card is slow, the trigger card slow method is reported on the upper link of the upper link.

  • MyAPM background, links to a set of IDs reported on the APP.Development classmates can analyze performance for slow card methods and upper -level links;


MyAPM reported card slow links to restore the process of calling for business methods. It is a lightweight stack/snapshot. The advantage is to avoid the performance consumption of printing stacks. Because in the slow monitoring of the card, the most consumed performance is to print the stack.

  • Collect the stack, auxiliary analysis:If certain card slow methods, you can’t analyze the positioning problem through the card slow link, you can push the specified method to the designated user app, and collect the corresponding stack information when the user specify the card slower method appears again, use the corresponding card to appear again, use the corresponding stack information. Use it. Use it. Use it. Use it. Analysis and positioning of assisted development of students.

3, Card Slow Example

In the slow monitoring of the main thread card, the more common cases are: main thread load files, underlying DB read and write, pictures processing these more time -consuming operations. Our optimized schemes usually move these time -consuming operations to asynchronous threads for processing.

The following are four cases films:

Example 1:

The main thread performs DB inquiries and causes card slow.

Average time -consuming view:

MyAPM background, the number of times of the slow link of the card will be counted, and the average time consumption of each node in the computing link will be.

card slow link last two sets of value meanings: (code call line number), [method average time consumption]. The time -consuming unit is MS.

8 8 8:

In a detailed view, we will list all the card slow instances and the user’s basic environmental information.

card slow link last two sets of value meanings: (code call line number), [method time time]. The time -consuming unit is MS.

Example 2:

Slow instance caused by the dex file in the main thread.

Example 3:

In the main thread, loading the local XML file and causing the card slowly.

Example 4:

In the main thread, the picture processing takes a lot.

proces () method consumes 1.3 seconds, SetFacadeimage (), and it consumes another 1 second.

4, the advantage of slow monitoring of MyAPM card

  • Monitoring particle size:MyAPM card slow monitoring of the particle size is the method.
  • Performance consumption:MyAPM card slow solution, which uses the card slow business link, is a lightweight business stack to avoid directly using the native stack. Avoid the performance of the stack. (Print original stack: 1-3ms, printing business link: 0.1-0.3ms).
  • Data report:uses a set of link IDs. Instead of stack information. The number of reports is small, no need to decompose the process.
  • code dependencies:card slow logic and business code are completely decoupled, transparent and zero perception of developers. It’s just in the test and inject before release.

5. Insufficient and plan

MyAPM, there are also insufficient. Because the injecting method will make the APK bag slightly larger.


Injects full business code with QZONE Android APK, its APK size increases by 0.5m, and the growth rate is 2.79%.


  • If the user is more sensitive to the size of the APK, you can use partial injection analysis.
  • can cooperate with MyAPM’s APK package size analysis scheme to make APK slimming analysis.

myAPM new features

APP card slow is only for the performance optimization of the problem method. In fact, for a product, we must not only pay attention to the problem of slow cards, but also need to pay attention to the conventional performance and monitoring of the app application.

Because this performance fluctuates, it will not be as obvious as the card is slow. However, in the new version iteration, the overall performance can be slowed down.

1. Surveillance app startup performance

  • We can customize the scope of slow card monitoring and provide personalized functions: only monitor the startup method.
  • Through data analysis and comparison, we can know:

app each version of the startup performance and change;

The differences in starting performance of each product connected by

enable each product to learn from each other.

2, core link analysis

Whether it is products, development, testing and operation and maintenance, you will want to know:

In an app, which codes belong to the core link?

What is the performance of

These core links?

In each new version, is the performance of these core links obviously lost?

We can continue to expand the scope of the card to the scope of slowly, and report the full amount. Through data analysis and screening, we can dig out core links and their performance data;

3. Late load

Through the link characteristics of the link, we can also extract the code for the number of calls, non -home scene calls. For these codes, when the APP starts loading, we can use delay loading. So as to improve the startup efficiency of the APP.

sequel description

app startup performance analysisandapp core link performance analysis, we will make a separate introduction in the future.


MyAPM is a new exploration and new practice in combining the actual needs of the department and the APM concept. Not only facing the positioning of performance issues, but also the analysis of daily app performance operations.

Simply share my thoughts and applications in mobile performance management. I hope everyone will create a performance small boat on their mobile terminals. At a critical moment, they will not say. mutual encouragement!


Random Posts

python regular expression Filgs parameter small base O

tensorflow learning information

SpringBoot+Jasypt+Dynamic Integrated Times Error

XMLHTTPREQUEST implementation user name

graphic gradient, scatterness, Lapras operator Graident, DIVERGENCE, LAPLACE Operator, or LapLacian defined on