Heavy! Another open source masterpiece by ByteDance

"BoostMultiDex" , a solution for fast loading of multiple DEX on Android devices with low versions (4.X and below, SDK <21).

For devices with lower Android versions (4.X and below, SDK <21), the Java runtime environment used is the Dalvik virtual machine. Compared with the higher version, the biggest problem is that the first cold start takes a long time after installation or upgrade. This often takes tens of seconds or even minutes, and the user has to face a black screen. After this period of time, the APP can be used normally, which greatly affects the user's experience.

You may think that there are very few phones with Android 4.X and below, but for apps with billions of users like Douyin and Tiktok, even if they account for 10%, the number is tens of millions. Therefore, if you want to get through the sinking market, the use and upgrade experience of these users cannot be ignored.

The technical implementation points of the BoostMultiDex solution are as follows:

Use system hidden functions to directly load the original DEX bytecode to avoid the time-consuming
multi-level loading of ODEX. Select the most suitable product from DEX bytecode, DEX file, and ODEX file to start a
separate APP process as OPT, and realize reasonable interruption And recovery mechanism
Compared with the official Android MultiDex solution, it can reduce the waiting time of the black screen by more than 80%, and save the upgrade installation experience of lower version Android users. And, unlike all the current optimization solutions in the industry, the BoostMultiDex solution starts from the underlying mechanism of the Android Dalvik virtual machine, which fundamentally solves the problem of long time-consuming execution of MultiDex for the first time after installing APK.

The performance comparison is as follows:
Insert picture description here

Guess you like

Origin blog.csdn.net/penggerhe/article/details/109290304