Android 2.2: A new lease on battery life

You'd think Android 2.2's acceleration of Java and JavaScript execution would boost overall speed, but the dramatic benefit lies elsewhere

When I got the over-the-air update from Android 2.1 to 2.2, I expected a faster and more reliable smartphone, based on Google's postings about the speed improvements to the Dalvik Java VM and V8 JavaScript engine. In truth, I barely notice the increased speed; the HTC Incredible already hummed along at a nice clip thanks to its 1GHz processor.

What I do notice is the greatly improved battery life.

[ Find out which mobile OS comes out on top in a head-to-head review of Google's Android 2.2 and Apple's iOS 4. | Keep up on key mobile developments and insights with our Mobilize newsletter. ]

Running Android 2.1, with moderately heavy use, the HTC Incredible's battery lasted about 14 hours. With Android 2.2, after that same period of time with the same usage pattern, the battery has 60 percent of its juice left. A light usage pattern leaves the smartphone's battery with 90 percent of its charge. This spectacular difference took me by surprise -- and removed the HTC Incredible's worst drawback.

This behavior actually makes sense. In Dan Bornstein's blog posting about the Dalvik JIT compiler, he says (italics mine):

"Dalvik" isn't exactly a household word (at least in my country), and most people wouldn't know a virtual machine if it hit them in the face, but when you tell them you were able to make their existing device work better -- run faster, use less battery -- they will actually take notice!

He goes on to explain about the JIT compiler and distinguishes between two kinds of applications.

Code that is written to run the CPU all-out can now do more in the same amount of time (running faster), and code that is written to be rate-limited can get its work done using less time and less of the CPU (using less battery). On the performance front in particular, we have seen realistic improvements of 2x to 5x for CPU-bound code, compared to the previous version of the Dalvik VM. This is equivalent to about 4x to 10x faster than a more traditional interpreter implementation.

If you're familiar with running Java applications on a desktop using the standard Sun Hotspot JIT compiler, you'll know that there's often a discernable lag as the application starts and the JIT warms up, after which the application comes up to full speed. That isn't the case with the Dalvik JIT compiler. Bornstein says his team is quite proud of this, and well they should be. I personally expected something on the order of a native Java pre-compiler would be needed to get the speed of Java-based Android applications tuned up, but an essentially warm-up-free JIT compiler is a much more elegant solution.

The cost of the JIT compiler in RAM is roughly 100KB for the compiler, plus roughly 100KB per JIT-compiled process. As Bornstein predicted, this doesn't noticeably affect the number of applications that can run in my phone.

I do have to say that the over-the-air upgrade experience wasn't exactly smooth. It took hours, or seemed to, and at many points the phone appeared to have crashed. When it finally seemed to be functioning normally, it really did crash, and I had to pull the battery to force a hardware reboot and get it back. But after that one hard reboot, it has functioned beautifully.

Now if only someone would only invent a way to read the LED-based screen in direct sunlight...

This article, "Android 2.2: An unexpected bonus," was originally published at InfoWorld.com. Read more of Gruman et al.'s Mobile Edge blog and follow the latest developments in mobile technology at InfoWorld.com.

From CIO: 8 Free Online Courses to Grow Your Tech Skills
Join the discussion
Be the first to comment on this article. Our Commenting Policies