Performance Trace Tool
From WeChat Android 6.5.10, we provide the Trace export tool. Developers can use it in the WeChat DevTools Trace Panel.
How to Use
adbtool needs to be installed on the PC. You can refer to some mainstream tutorials for installation. You can use brew to install it directly on the Mac.
- After confirming that the
adbtool has been successfully installed, open Trace Panel in the WeChat DevTools, connect the Android phone to the PC via USB, and click Choose Devices. Then the connection authorization box may pop up on the phone, and click Allow.
- After choosing the device, open the developer version of the Mini Program you need to debug on the phone, open the performance monitoring panel via the menu in the upper right corner, and restart the Mini Program;
- After restarting, perform operations in the Mini Program, and then export the Trace data via the menu in the upper right corner.
- The WeChat DevTools Trace Panel will automatically pull the Trace file, so select the Trace file you want to analyze;
You can use the
adb devicescommand to determine if the device has established a connection with the PC.
From WeChat 6.5.8, we provide a performance panel to let developers know about the performance of the Mini Program. Developers can enable the performance panel in the developer version of the Mini Program. Method: enter the developer version of the Mini Program, click the More button in the upper right corner, and click Display Performance Window.
Performance Metrics Description of Performance Panel
|CPU||CPU usage of Mini Program process, only available for Android|
|Memory||Memory usage of the Mini Program process (Total Pss), only available for Android|
|Startup time elapsed||Total time took by the startup of the Mini Program|
|Download time elapsed||Time took by the download of the Mini Program package. It will be downloaded when it is first enabled or when the resource package needs to be updated.|
|Page switching time elapsed||Time took by the page switching of the Mini Program|
|First rendering time elapsed||Time took by the first rendering of the page|
|Second rendering time elapsed||Time took by the second rendering of the page (usually triggered by the developer's setData operation)|
|Data cache||Cache size stored by the Mini Program via the Storage API|