JIT

What is the JIT?  JIT stands for "Just In Time," and we use it to describe a Dalvik JIT compiler, which was added to Android with the 2.2 release.  It compiles bytecode into native machine code at runtime.  Essentially it takes the code for an app, analyzes it and converts it into something that runs faster.  It does all this while the application is running, and that's where the "just in time" tag comes from.  The JIT compiler designed for Android also can do this with a very short "warm up" time, meaning it doesn't take very long to analyze the code before it starts working.  It stores information in a cache in your phone's RAM, which means it's not an ideal solution for devices with low memory.  It's been optimized to have a small footprint -- about 100K per process -- but even that is enough to impact performance on older models like the G1 or HTC Magic.  This is why most phones that came before the Nexus One never got an official version from Google -- hardware limitations.

You hear terms like "runs faster" or 4 to 5 times performance increase anytime you talk about Android's JIT compiler.  A JIT compiler simply saves CPU cycles -- more work can be done for each clock cycle.  This means applications that were throttled by CPU performance get faster, and apps that are "rate-limited" (run until they are finished without taxing the processor to the maximum) finish faster and use less battery because of it.  Not all applications see a significant speed increase, and most applications written with the NDK or in native code won't see an increase at all, as they don't use the Dalvik virtual machine.  

If all this reads like Greek to you, that's OK.  To the end user (that's you and me) all we should see is better performance in most of our applications.  We certainly saw that when Froyo was released for the Nexus One, and things have just gotten better with every release.  For the more technically inclined, check out the video from Android engineers Ben Cheng and Bill Buzbee during Google I/O 2010 where the JIT compiler was introduced.

Previously on Android A to Z: What's an IPS display?; Find more in the Android Dictionary

More from the Android Dictionary

CWM
Article
by Jerry Hildenbrand
May 23, 2012
We're getting a little hacky in this round of Android A to Z, and we're going to have a look at ClockworkMod recovery -- the de facto standard of custom recoveries for Android. It's...
Android A to Z
Article
by Jerry Hildenbrand
May 22, 2012
When you think of Android phones, you think of bloatware. We wish it weren't so, and not every phone comes with, but the majority of Android phones out there come from carriers and are chock ful...
AOSP
Article
by Jerry Hildenbrand
May 21, 2012
AOSP is a term you'll see used a lot -- here, as well as at other Android-centric sites on the Internet. I'll admit I'm guilty of using it and just expecting everyone to know what I'...
A to Z: Widgets
Article
by Jerry Hildenbrand
Feb 07, 2012
What is a widget?  In Android, the word widget is a generic term for a bit of self-contained code that displays a program, or a piece of a program, that is also (usually) a shortcut to a larger...
tethering
Article
by Jerry Hildenbrand
Feb 03, 2012
What is tethering?  Besides the grounds for a giant debate about ethics (the kind that you can only find on the Internet) tethering, in this case, means to share the Internet connection from yo...

 
There are 3 comments

ScottJ says:

That's a pretty good explanation. To improve it, I would have contrasted JIT compilers with the traditional offline compiler paradigms.

ionatomic says:

You don't know JIT.

jrenner says:

The url representation of this page made me chuckle. Clearly it edits out common words including 'a', 'to', 'is', and 'the'. Leaving us with the trolling sounding "android-z-what-jit" :P

Oh and good article!