App optimization after updates is much quicker on Android N

by: Bogdan PetrovanMarch 10, 2016

android update 2

Android N is changing the way app installation and app optimization are handled.

If you’re lucky enough to have a device that receives frequent updates, you may be familiar with the slight annoyance of having to wait for your apps to “optimize” for the new system version.

During this process, apps are pre-compiled in a process called Ahead-of-Time compilation, which basically ensures that apps are ready to run the instant you tap on their icon, as opposed to having to wait several seconds when you launch the app. This behavior was introduced with the ART (Android Runtime) virtual machine, which was previewed in KitKat and fully launched in Lollipop.

Before ART, the Dalvik virtual machine used Just-in-Time compilation, meaning that apps were compiled at runtime.

With Android N, Google is changing things up again. To cut on the long time required to compile apps when the system is updated (depending on the system, this may take 20 minutes or more), Android N now switches back to Just-in-Time compilation, but only the first times an app is launched. After that, Android N proceeds to compile apps Ahead-of-Time, presumably during idle times.

What does all this mean in real life?

  • You won’t need to wait 5-20 minutes for apps to “optimize” after every update;
  • Immediately after an update, apps will launch a little slower than normal (due to Just-in-Time compilation);
  • After a few hours, app launch speed will return to normal (because the system compiled them Ahead-of-Time during idle time);
  • New apps will be installed much faster, but the first time you launch them, they will open slower than normal (due to Just-in-Time compilation).

There you have it – a seemingly small, but very welcome improvement coming to Android N. For more on Google’s latest, make sure to check our complete Diving into Android N series.

  • Björn Rostron

    Uggggh finally…. I update and change roms frequently. The annoyance of having to wait 15 minutes for my 200 apps to optimize kills me.

  • Andrew

    Cue hoards of the uneducated hastily complaining about Android System draining battery after an update because they don’t understand this is now taking place in the background as opposed to something they can ‘see happening’.

    However, this is a welcome change IMO, good thinking Googlers! Had this annoyance after the patch this morning which chewed up 20 minutes of my morning routine reading the news at 5am!

  • Jairus

    Finally, after lollipop was introduced, updating Facebook and other apps that is more than 30mb in size are taking over 10 minutes just to install. Sometimes, they just fail to install or update for unknown reason.

    • EasyCare

      Same. Heck, my phone even soft-rebooted during Facebook update.

    • sluflyer06

      Sounds like a facebook problem not a android problem. I have many apps that far exceed 30MB and nothing has ever taken 10 minutes to install let alone even 2-3. Long install times I’d consider anything over a few seconds.

  • Marius Tomas

    Finally, just as Andrew mentioned we will definitely see tons of people dropping s*****one android again after this. Thought it’s great improvement! Although android N won’t have much esthetic changes such internal improvements makes me feel really exited about N :)

  • This is one thing I hated after installing an Android update on my 2013 Nexus 7. Not only does it take up to 15 minutes, it drains the battery down about 15% while it is optimizing

    • Shawn Hamm

      It’ll still drain about 15% while optimizing. You’ll just be able to actually use the device while it does so.

  • Ahmad Zuhdi Ubaidillah

    Ughh hybrid compiler sounds amazing

  • charlie Jason

    You know what I really want? I really want them to not implement force touch. I don’t wanna have an apple copy feature. And it’s not that useful either.

  • KeyserSoze

    Nah, I’d rather have my all my apps compiled up-front in one shot and get it out of the way rather than have it done half-assed piecemeal. Point is, everyone’s preference is different so Google should make both options available with a toggle setting.

    • Virtual anoamly

      Yeah,well it takes my apps an hours to optimise them. Damn Google. Good change. I hate waiting approximately an hour and 45 minutes after any update,even security patches

      • LethalLunatic

        Might be useful for now to do it overnight?

    • abqnm

      With monthly security updates that 20 minute wait becomes quite a headache. Also not having app updates take 5+ minutes per app on large, complex apps (like Facebook) is a far better solution. JIT didn’t take but a few extra seconds to load an app, but AOT takes forever to compile the first time.

      A hybrid system seems to be the best of both worlds.

  • Flow

    Praise the lord

  • What does all this mean in real life?
    1)ART use almost 2 to 2.5 times more storage space to save the compiled code.
    Some useless apps such as G+ and some other apps come with phone use minimum 300mb or more. We never use those apps and wasting our storage space. So after Android N this apps will not use that much space?

    From this article I understand the ART approach will only work once we launched that application. If we never open an application it will not compiled and we save storage space!!

    2) Faster app installation (I don’t care)

    3) Faster reboot after update
    Yea!! Phone will over heat after an update. Actually we can use that phone to cook food.