Hacker News new | ask | show | jobs
by Zigurd 4619 days ago
Much of the Android OS's middleware layer is implemented in Java, and runs in a Dalvik VM instance. Many parts of the OS are implemented as Service components and accessed through remote procedure calls - the same way installable apps can provide APIs to other apps.

Contrast this with the history of the CLR in Windows mobile devices. It was not taken seriously as an application platform. None of the built-in apps used it, never mind it being the basis for system programming. Android is a Java OS in a more meaningful way than running a CLR for some subclass of apps, which certainly doesn't make Windows a "C# OS."

Try writing a non-game Android application with every Activity component as a NativeActivity subclass. It will be painful to code, more painful to debug, and it will disappoint in performance.

I'm not just shilling for Google's architectural decisions. Prior to Android being released, I was working on wireless device OS that used Linux and a Java VM for userland software. I am very familiar with the performance increment obtainable using a JIT in a mobile device, and, as an alternative, in using a precompiled Java runtime. As in Android, the heavy-duty pixel-pushing in that OS was done in a graphics stack implemented in native code. Much of Android's widget set is also in native code. Unless you choose to do heavy computation on an Android device, you are not going to get a large advantage from a JIT, especially if your bytecode interpreter actually does perform 2X better than Java.

As for heavy computation on Android devices that's what Renderscript is for.

1 comments

So why do native Objective-C/iOS and native .NET/WP 8.x apps work faster and more fluid than Android ones?
Mainly due to differences in multitasking.

Android always enabled completely general multiprocessing and multithreading, initially at the expense of smooth visual effects, and Android was implemented on a variety of CPUs and GPUs. Secondarily, Android didn't used to have concurrent GC. Thirdly the animations were not tuned (q.v. Butter). Fourthly, the graphics stack was tuned to use more GPU-based operations as mobile GPUs improved. If you know you have only OS overhead when you are the foreground task, lots of things get more deterministic. But that does not mean you have more total throughput.

For that matter, Android didn't have low-latency audio until 4.2.

Try taking a look at how many processes, and Dalvik instances, are running concurrently at boot time on an Android device. Then try just starting that many VM instances, of any VM, on any other OS. The reason Microsoft has gone to pre-compiling "in the cloud" is that otherwise the CLR has a miserable startup time and mediocre performance. The CLR architecture is much more like a conventional Java VM. You can't build a whole OS on a managed language implementation of OS features with that level of performance.

I'd wager Microsoft has a much rougher road ahead stuffing a real Windows kernel into handsets and maturing CLR performance, memory efficiency, and battery life for comparable computing tasks that Android handles well in all performance dimensions.

> For that matter, Android didn't have low-latency audio until 4.2.

It still doesn't, https://groups.google.com/forum/#!topic/android-ndk/qACobHa8...

The person who posted that comment is behind the times re audio on Android.

Android can deliver very low audio latency and do it consistently, but the OEM has to test that their CPU power management and other kernel configurations have not screwed it up, and those tests are not baked into ACS.

The OEM should, at least, correctly use the feature flag for low-latency audio, leaving is off if they don't actually know. But specifying that flag in your manifest means your app loses access to devices where good enough is good enough.

Here is a low-latency polyphonic synth: https://code.google.com/p/music-synthesizer-for-android/

This synth was the test case for development of low-latency audio.

> The person who posted that comment is behind the times re audio on Android.

No, that person has real life experience what means to develop for Android while targeting the majority of devices available to consumers.

All your answers so far were very good and I appreciate the time you took to answer them.

However, those of us that target all three major mobile OS across multiple OEMs, have a different experience of what Android's performance on real devices looks like.

And to conclude this thread, Google agrees with us, otherwise they wouldn't have spent $23 Million buying FlexyCore if Android's performance on real devices was so good as you have been defending.