# Startup performance
Weixin Mini Program Startup is a very important part of the Mini Program experience, and too long startup time will cause the loss of Mini Program users and affect the experience.
The "start" in this chapter refers to the cold start, excluding the hot start of the Mini Program background and the front desk.For the definition of cold / hot start, please refer to Mini Programs running mechanism
# 1. Weixin Mini Program Definition of startup
Weixin Mini Program The startup process starts with "User opens the Mini Program" and ends with the Mini Program "Home page rendering completed" .
"User open Weixin Mini Program" may be triggered by the user click access, may also be triggered by scanning the code, the Mini Program jump Mini Program or APP opening Mini Program entry.When opening the Mini Program from the scene of scanning code, APP, etc., there may be a pre-jump and validation process, which is not included in the discussion of the Mini Program startup process.
Weixin Mini Program "Home page rendering complete" flag is triggered by the first pagePage.onReadyevent. Due to differences in the startup process, the "Home Page Render Complete" defined by the Mini Program is not equivalent to theDOM Content Loadedorload [events of the browser.
To understand the specific process of starting Weixin Mini Program, please refer to the introduction of "Small Program Starting Process" chapter.
# 2. Open rate / arrival rate
Weixin Mini Program The ratio of the number of times the "home page rendering completes" to the number of times the "Mini Program starts" is also known as the (PV) open rate or (PV) arrival rate.The correspondingdrain rate = 1 - open rate.
The opening rate was influenced by the following factors:
- Startup performance : The longer the startup takes, the longer the white screen time, the more likely the user is to quit Weixin Mini Program because of losing patience, the lower the open rate will be;
- User Willingness to Wait : The stronger the user's willingness to wait, the longer the wait time will be, and the higher the open rate will be when the startup time is consistent.The user's willingness to wait is related to the scenario where Weixin Mini Program is used, for example:
- In scenes where users have a strong purpose, such as scanning and searching, they often have a greater willingness to wait.
- In an ad-type scenario, the user's willingness to wait is low, and the startup performance optimization is more necessary to obtain a higher opening rate.
# 3. Startup performance optimization
In the Weixin Mini Program startup process, the time spent on code pack preparation, Mini Program code injection, and home page rendering is related to the Mini Program itself, and the developer can do some optimization.The rest of the time consumed is responsible for continuous optimization on the side of the Mini Program framework.
Developers can begin to optimize startup performance in the following areas:
In addition to the above three parts, there are a number of factors that can affect Weixin Mini Program startup time. Refer to Other Optimization Recommendations
If you want to better understand and analyze the performance of Weixin Mini Program, you can refer to "Performance Data" chapter.On average, we recommend that the startup time of a Mini Program should be controlled at:
| Android | iOS | |
|---|---|---|
| When you need to download or update | 3.7s | 1.8s |
| When using local code packages | 2.6s | 0.9s |
| The broad market average | 3.0s | 1.2s |