Android's new, largely undocumented compilers are still works in progress, but aim to speed up the compilation process
With Android 5.0 Lollipop now winging its way to phones, Google has
quietly made changes to Android's compiler tools as well. New for
developers is a pair of compilers, code-named Jack and Jill, designed to
speed up Android app creation.
Java
source code is currently compiled for Android apps by way of two build
tools: the Javac compiler, which yields Java bytecode, and the Dex tool,
which converts the Java code into the Android-specific Dalvik bytecode.
With Jack, both steps are combined in one, using the Java compiler
provided by the Eclipse Foundation to do its work.
Jill works as a
precompiler to convert class and runtime libraries into Jayce bytecode.
Jack then uses that bytecode as part of its own compilation process.
In
his testing, LaFortune discovered that the new compilers don't yet
support the full range of options available to the current generation of
Android compilers -- a sign that they're still works in progress. Jack
and Jill don't support Java 8 yet, either, although LaFortune found the
compilers do seem aware of 1.8-level features such as closures, but
simply choose not to implement them.
Android's Java-based
underpinnings are getting a major reworking. Most important, for both
Google and its developers, is the switch from the Dalvik virtual machine
to the Art runtime. Art provides better performance -- typically around
twice what Dalvik provides -- without placing an additional burden on
the developer. Another reason for the shift to Art may be to reduce
dependency on Dalvik, since Google's creation of that Java-compatible VM
inspired a lawsuit by Oracle that is still grinding its way through the courts.
Jack
and Jill don't directly affect how Art since Art compiles Dalvik
bytecode on its own into native code. That said, the optimizations
carried out with Jack and Jill indicate the entirety of Android's
environment, from development toolchain to runtime, is being transformed
from the inside out -- although not always in plain sight.
No comments:
Post a Comment