Hacker News new | past | comments | ask | show | jobs | submit login

I haven't yet studied ART in detail, but I think one reason to compile at installation time is so the compiler can analyze the whole program, including the libraries provided by the OS. If just the application code were AOT-compiled to native code as part of packaging, the compiler would miss out on a lot of optimizations that are available to a whole-program-optimizing compiler. And note that JIT compilers basically do whole-program optimizations, such as devirtualizing and inlining methods, eliminating null pointer and exception checks, and others. So a unit-at-a-time AOT compiler would be worse than a good JIT compiler. But a whole-program-optimizing AOT compilation step at packaging time would require every application to statically link all the OS libraries. Compiling to native code on the device at installation time seems like a good solution to me.



Whole program optimisation would require a recompile at every system update wouldn't it? With lots of apps that would be pretty costly.


Every Android system update already has stage where it prepares every app.


Every time there is a system update, it recompiles all the apps.


I still have a Nexus S. With early versions of ART in Android 4.4, booting the system and precompiling everything took more than half an hour! Current hardware is much faster, though.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: