Hacker News new | ask | show | jobs
by WildUtah 4518 days ago
The jankiest thing about Android (well, aside from crappy manufacturer skins and undeletable carrier spamware) is the pauses and delays in user response. Those all come from the disastrous choice to use Java as a programming language. User facing software always feels slow when it's subject to the performance losses of automatic memory management. Java is inherently garbage collected and low power mobile devices just multiply the performance failures inherent in that design.

Garbage collection is actually better for performance where instant response isn't important, such as in servers. In UI and realtime it always seems janky and slow.

But even the choice of Java is related to multiple hardware vendors. There was some idea initially that Android might run on non-ARM platforms. That hasn't turned out to be an important use of Android, but it probably helped push Android to Java initially.

3 comments

You have no idea what you're talking about. The only part of Java used in Android is the syntax. The VM was written from scratch. In fact, Oracle took Google to court over allegations that Google had copied parts of the Java VM (and lost on the majority of counts, getting no payout).

And there is also the fact that I know it's not true because my phone (LG G2) has no problems with touch response.

It's important to note that it's the Java language, but not the Java bytecode or Java Virtual Machine that are used in Android. It could easily have been really any language that Google wished to provide a compiler for towards their custom bytecode/VM. It was somewhat arbitrarily the Java language but was a good business choice IMHO due to the prevalence of Java developers in the market.

Secondly, there's nothing stopping you from writing your apps in C/C++ to get whatever sort of response you need.

From what I've read on the net, using the NDK is not an ideal way to write Android apps. It's fine if you want to write an OpenGL game, but it doesn't interface well with the Android API.
I don't know enough about Java/garbage collection but I'm going to challenge your assertion that Java is behind poor UI response.
Okay, I'm listening.