Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For example: http://developer.android.com/reference/android/graphics/Canv...

Notice the introduction of methods with API level 21 that recreate existing functionality without RectF objects being allocated. Touch events, for example, still spit ludicrous amounts of crap on to the heap.

All this is why the low latency audio is via the NDK as it's basically impossible to write Android apps which do not pause the managed threads at some point. Oddly this is stuff the J2ME people got right from day one.



That's terribly ugly. Can they not do escape analysis or something to avoid allocations in obvious places? Or only allocate when the value is moved off the stack?

Doesn't Android use a different flavor of Java anyways, allowing them to make these changes?


Yes, it's possible in theory, but Dalvik/ART don't do it. HotSpot does some escape analysis and the Graal compiler for HotSpot does a much more advanced form called partial escape analysis, which is pretty close to ideal if you have aggressive enough inlining.

The problem Google has is that Dalvik wasn't written all that well originally. It had problems with deadlocking due to lock cycles and was sort of a mishmash of C and basic C++. But then again it was basically written by one guy under tight time pressure, so we can give them a break. ART was a from scratch rewrite that moved to AOT compilation with bits of JITC, amongst other things. But ART is quite new. So it doesn't have most of the advanced stuff that HotSpot got in the past 20 years.


Yes, this is why I always find sad that language performance gets thrown around in discussions forums without reference to what implementations are actually being discussed.


J2ME got some bad naming due to the firware problems that OEMs brought to the platform, but Android is becoming worse than it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: