What will it take for Google to bring 64-bit support to Android?
Interestingly, the comment thread of the editorial didn't focus so much on the question that I had posed, but rather on a run of information from a reader by the name of JakeLee. JakeLee didn't so much refute the points I had laid out as he claimed that Google has a long, difficult road ahead if it expects to optimize Android for 64-bit in the near future. The info from JakeLee has helped to inform this article. Although, my own research into the matter, and help from the Android Developers community on Google+ has shown that the future may not be as troubled for Android as JakeLee made it sound.
The work that has been done
64-bit version of its Exynos chipset. Qualcomm obviously had a bit of a PR fiasco after Apple's announcement, but then recently introduced its first 64-bit mobile processor, the Snapdragon 410, with the implication being that the mid and high-end Snapdragon 610 and 810 would be on the way at some point, and also support 64-bit.
Some also mistakenly try to point to Android 2.3 Gingerbread as a point where Google trying to push Android into a 64-bit world. When Gingerbread came out about three years ago, Google made it a requirement when compiling the actual Android system software to use a 64-bit environment. But, this requirement didn't actually bring the Android software itself any closer to 64-bit support, it was only done in order to reduce the time it took to build the system software.
The work left to be done
Yep. That's it. That's all that has been done. Some of you may have expected that last section to be longer, but so far Google has not been taking many steps to bring 64-bit to Android. In fact, there has been no change to the Android Developers documentation, which still states that “Android is currently expected to run on 32-bit platforms. In theory it could be built for a 64-bit system, but that is not a goal at this time.”
All of the Android runtime libraries (media, graphics, file system, etc) and the drivers for the myriad devices are all 32-bit, and would need to up rebuilt for 64-bit, but this shouldn’t be too difficult to do. Really, I could end this section right here, because that’s all the work that needs to be done to move Android to 64-bit compatibility, at least on Google’s side.
Another issue that came up quite a bit in JakeLee’s comments was the fact that Android’s Dalvik Virtual Machine uses a 32-bit register, but that turns out to not really be an issue at all. To simplify the explanation of how an Android app works - a developer will write the app code in Java which gets compiled and packaged as an APK. There are then two ways APK is run on an Android device - either the Dalvik VM will execute it directly as bytecode using the Dalvik just-in-time (JIT) compiler. Or, the new ART (Android Runtime introduced in Android 4.4),
Right now, both the Dalvik VM and ART use a 32-bit register, and there is really no way to change that with the current implementation. But, these registers are abstract entities not related to hardware, so they wouldn’t really cause any problems in switching Android to 64-bit. As stated above, the app code is executed directly, so any apps written in Java would be able to run without issue. At most, an app might have to pass through an interpreter, because of minor differences in coding for 32 and 64-bit in Java. But ultimately, using Dalvik or ART makes it easier for Android to move to new hardware (ARMv7, ARMv8, x86, etc) rather than making it more difficult.
The only real issue that Google would face as far as apps and compatibility is with apps that use Android’s NDK to code with C/C++. Those apps would need to have the native bits rewritten for 64-bit compatibility, or else Android would have to have two different versions of the runtime to accommodate those apps, which could lead to performance and battery life issues.
The same major roadblock as always
All of that aside, you hit the only real roadblock, which is the same roadblock that has caused problems with Android since its first days. Google would have to do something that it has never been able to do before with Android - getting developers and manufacturers to follow the plan, not jump the gun on hardware, and push software updates quickly.
This has been a constant struggle for Android, and one that has been getting better over time, but one that still isn't fixed enough to make the transition to 64-bit any easier. As we’ve seen with tablets and multi-core processors, Android hardware makers never want to wait for the system to be optimized before introducing new hardware. Android tablets first shipped well before the system Android 3.0 Honeycomb update, which was just a stop-gap on the way to the proper Android 4.0 Ice Cream Sandwich update.
The real work will be in getting developers to update apps with native code for the new 64-bit platform; but it is obvious that the 64-bit hardware is coming soon, much sooner than it will take Google to update Android for 64-bit. This will lead the whole ecosystem to end up in the same vicious cycle where manufacturers will push hardware before the software is ready, and then will likely be slow to update software once the optimizations are done. The first part of the problem will likely occur not through any fault of Google's, but rather because manufacturers (read: Samsung) will want to make sure they have that 64-bit processor in the newest flagship device - and more importantly, in its marketing campaign - before Android is ready to handle it. Then, once Android does get the update to 64-bit, users will have to wait a bit for manufacturers to push out that update.
Of course, this isn’t necessarily a problem for consumers per se, more of an annoyance for those of us who pay attention and understand the real story. All it means is that we will all be subjected to marketing campaigns touting features that offer no real value, which is nothing new. We've seen plenty of features gracing various marketing campaigns that don't really make much difference to the majority of users, like Air Gestures, Face Unlock, and Siri. Samsung and others will undoubtedly market that their products have 64-bit processors, and will conveniently leave out that they offer little to no benefit because the software isn’t ready. But, that is the way marketing works all around anyway, and the average consumer won’t know the difference anyway.
A slow path to faster speeds
While hardware manufacturers plan to jump the gun and put out 64-bit hardware running software that isn’t optimized, Google hasn’t mentioned at all when we should expect a 64-bit optimized version of Android. Getting there will doesn’t look to be that rough of a road, but it will certainly take time to get there. So, it’s impossible to say when Android will be fully optimized from top to bottom.
All of this needs to be sorted out, because ARM processors are quickly hitting a performance plateau, because of an outdated instruction set architecture (ISA). ARMv8 has introduced a completely new ISA, and made the switch to 64-bit, both changes which will lead to faster speeds as long as software is optimized properly. Unlike on desktops, the argument about hitting the 4GB RAM limit is nowhere near the most important factor when talking about the performance benefits of moving to ARMv8 and 64-bit. Clock speeds can’t get much faster without causing heat and battery issues, and adding more cores will only get you so far, unless they are specialized cores to offload low-power processes, like we’ve seen with the motion and voice coprocessors in the Moto X and iPhone 5s. The most efficient way to increase performance on an ARM chip is to switch to the ARMv8 architecture because it can do the same in a single transfer as 32-bit ARM can in as many as 32 transfers, but that requires the software optimizations before you see the real performance increase.
So, we should all prepare ourselves for a lot of empty promises from Android hardware makers over the next year. But, if we keep an eye on Google, and the news coming out about the official software optimizations, we should get a much better idea of when to expect the real changes. 64-bit is certainly on the way, but the real news will be when Android is properly optimized for ARMv8.
reference: Is Android 32-bit or 64-bit?, Android Developers 1 & 2, +Android Development Community (a special thanks to Bartlomiej Janusz for being so patient with my questions)