Re:Android: Faster emulator with better hardware support
by drewcrawford on Monday April 09, 2012 @05:10PM
(#3819247)
As an iOS dev, I can tell you, I would much rather be doing my perf optimization on real hardware than on an emulator, even one that emulates clock-for-clock (and I highly doubt that the Android NDK does, although perhaps they ship a tool that lets you extract this information).
Just for starters, if I am profiling code, it's probably because the code is slow. (Infamously, for awhile we had a 13-hour unit test). If a quad-core 1ghz ARM device is slow, the last thing I want to do is throw an emulator into the mix.
Re:Android: Faster emulator with better hardware support
by nekitamo on Monday April 09, 2012 @08:13PM
(#3819991)
The binaries built by the Android NDK are emulated on the emulator properly. I've deployed NDK binaries on the emulator and traced it with IDA Pro, one line of ARM assembler at a time... So yes, it's a proper emulator.
Just a fact I thought you might find interesting.
Re:Android: Faster emulator with better hardware support
by drewcrawford on Monday April 09, 2012 @09:32PM
(#3820246)
But does an ADD instruction on ARM take the correct multiplier of time as the MUL instruction? No, because time-accurate emulation is shockingly hard. Further reading:
http://arstechnica.com/gaming/news/2011/08/accuracy-takes-po...
Re:Android: Faster emulator with better hardware support
by hub_ on Monday April 09, 2012 @05:19PM
(#3819292)
Performance testing in any case has to be done on the target device. Neither iOS Simulator nor the Android Emulator are appropriate.
Re:Android: Faster emulator with better hardware support
by com2kid on Monday April 09, 2012 @08:25PM
(#3820025)
True enough, but aspects like memory consumption can still be tested on an emulator. Due to differences in x86 and ARM code gen, it can be beneficial to get actual numbers.
There are also aspects like ease of automating. An emulator running on a desktop is easier to fiddle with than an actual device.
Re:Android: Faster emulator with better hardware support
by m_eiman on Monday April 09, 2012 @05:01PM
(#3819213)
There are different trade offs for each technique. Aside from ensure that native code functions properly (e.g. Android NDK)
How about running dalvik in x86 and just emulating NDK calls? Should give a nice speed boost while still supporting native ARM code.
With Android apps running in a VM this is not as much of an issue, but it is still nice to have.
The downside is that writing performance emulators for 1ghz+ multicore ARM chips is hard. :) GPU virtualization helps out a fair amount with this.
As an aside, they do have a virtualized mode that appears to be sort of a hybrid between an emulator an Apple's technique. I believe they are still running the entire Android OS, but it is a native x86 version of it so you get much better performance.
The other cool part about having an emulator is that once your emulator is complete enough, you can add in emulation support for all sorts of sensors, GPS, etc, and they are truly emulated and the programmer can interact with them the same way they would on the device (with the need for some sort of "feed arbitrary input" code paths of course).
When you just have a glorified UI toolkit that has been ported to the Desktop, everything else (GPS, sensors, etc) can end up special cased.