Has the Huawei Ark compiler gone too far?

After Android 7.0, Google also realized the problem of programs taking up space and slow startup. What should I do? Google found that when people use a program, it is impossible to use all the functions. So is it more efficient to only compile some commonly used ones? So at this time, JIT is actually brought back to Android, and there is no need to fully compile it during installation, just install it directly, which is of course faster. This is actually the middle layer, JIT, and AOT coming together, and according to the user's habits, the common function codes of commonly used programs are explained and stored, so that users can use them again quickly.

After Android 7.0, what Google does is optimization. The 8.0 system has an interpreter, which improves the interpretation speed of "cold code". The latest 10.0 (Android Q) system will even know in advance what codes are commonly used by users in this program during installation. The installation time is slightly longer, but the hot codes have been explained, further improving the speed.

In the Ark compiler, the compiled APK will be converted into machine code through static compilation before installation. This is actually AOT, which does not require a troublesome virtual machine and improves running speed and efficiency. And as a developer, you can also choose different compilation optimization solutions based on different program characteristics, unlike the official Android method of using a unified virtual machine solution.

A major feature of current Android phones is that the memory is getting larger and larger, and 6GB is the configuration of mobile phones for the elderly. In addition to the large size of the program, this is related to the fact that Android programs generate a lot of garbage when running. What about cleaning up the trash? Then the program needs to be paused, and there will be a pause, which is the so-called "stuck". Huawei's Ark compiler takes advantage of the multi-threaded running characteristics of the program. For example, the "Zhongguancun Online" APP you are using now uses two threads A and B. In Huawei's P30 mobile phone, when thread A is running, thread B is cleaning up garbage, and then when thread A is cleaning up garbage, thread B is cleaning up garbage. When running, the program runs without interruption and garbage processing continues, achieving continuity and saving system resources.