Android N feature preview JIT Just-In-Time app compile

As those who often flash ROMs, and anyone who’s done an OTA or factory reset know, one of the most frustrating things with Android is waiting for it to compile our apps on first boot.

Since Dalvik was left behind for ART Ahead-Of-Time (AOT) compilation in Lollipop, first boot has become a frustrating test of patience. With the ever increasing size of Android system apps and manufacturers continuing to bulk ROMs up with their own apps, the first boot after a ROM install or factory reset can seem like an eternity.

glass_android

One of the biggest things to look forward to with Android N is Just-In-Time (JIT) compiling. That is, apps will compile as they’re used, instead of compiling 100+ apps at first boot after OTA/factory reset/ROM install.

The first run of an app will be slightly slow, but after that will boot as normal. The bonus here is that there’s not a 10 minute wait for apps to compile on the first boot.

Hybrid compile mode

Android N won’t use a full JIT setup, but a hybrid-mode which will also compile apps AOT when the phone is “idle and charging”.

Says Google, “ART manages profile-guided compilation in a way that minimizes impact on the device battery. It does precompilation only when then the device is idle and charging, saving time and battery by doing that work in advance.”

App installs

In addition, apps which are installed from Play will install much quicker, because they won’t compile on install, but on first run, or when the phone is not in active use.

Says Google, “One of the most tangible benefits of ART’s JIT compiler is the speed of app installs and system updates. Even large apps that required several minutes to optimize and install in Android 6.0 can now install in just a matter of seconds. System updates are also faster, since there’s no more optimizing step.”

In summary

  • No more waiting for 100+ apps to “optimize” after OTA, factory reset, PC ROM flash
  • JIT compilation makes the first run of an app slightly slower, but after that first run will boot as quick as usual
  • While the phone isn’t being actively used, it will AOT compile apps which haven’t been compiled yet
  • New app installs will happen quicker

This is one of the more exciting things to see happen in a while with Android and we’re looking forward to giving it a test run, especially with mobiles such as Xiaomi which have weekly updates.

Comments

2 responses to “Android N feature preview JIT Just-In-Time app compile”

  1. Anton Avatar
    Anton

    It will be better if they will give us chance to choose what we need. As for me, I’ll more happy with AOT and wait 10-15 min after OTA. I don’t want to wait a few minutes before start all new apps.

    1. Damian Parsons Avatar
      Damian Parsons

      It shouldn’t be a few minutes. Each app shouldn’t take more than a few seconds to compile. Same as when you install an app from Play. That short wait after the download is finished is the compile time. So now, that short wait will be when first opening the app.

      In addition, apps yet compiled will compile in the background when the phone is idle.

Leave a Reply

Your email address will not be published. Required fields are marked *