Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Android emulator performance compare to real device performance?

I'm looking into writing an Android game, tough I don't curerntly own an Android device. For those of you who own a device, how does the performance on the emulator relate to real device performance? I'm especially interested in graphics related tasks.

This obviously depends on both the machine running the emulator, and the specific device in question, but I'm talking rough numbers here.

This question is a duplicate, but since that post is heavily outdated, I figured it's irrelevant by now.

like image 849
uj2 Avatar asked May 23 '10 20:05

uj2


People also ask

What are the difference between Android emulator and real device?

Android Emulators vs Physical DevicesAndroid emulators simulate the hardware and software of Android devices on your computer so that you can test your Android apps without having a physical device in hand. While easily accessible and inexpensive, emulators have significant device hardware and software limitations.

What is the difference between emulator and real device?

The emulator/simulators are not able to simulate the battery issues. Real-world devices can easily perform the same. The emulator/simulators are not able to simulate the incoming interrupts for SMS as well as the incoming calls. Real-world devices can easily simulate incoming interrupts.

How emulators are different from other devices?

Emulators mimic all the hardware and software functionalities of real mobile devices for development purposes. However, they do not replicate the device's behavior and its configurations.

Which scenario can test only on real devices but not on an emulator?

Real devices can be used for critical scenarios and in situations like memory leaks, high CPU usage, latency, and while having network issues that might fail when tested with virtual devices.


1 Answers

Generally speaking, the emulator is much slower than a device at CPU and GPU tasks. That's for at least two reasons:

  1. The emulator is running ARM opcodes, converting them into equivalent x86 instructions, which is slow
  2. Devices (usually) have graphics accelerators, whereas the emulated environment does not, despite whatever video card you have on the machine running the emulator

To put things in perspective, I do my Android work on an Intel quad-core 2.66GHz with a fairly nice graphics card. For videos that work fine on devices, I can sometimes get them to play back in the emulator.

The emulator is faster than a device, though, at "disk" I/O. When you write to "flash" on the emulator, you are writing to a disk image file that probably resides on a regular hard drive, assuming you're not using an SSD. Actually writing to flash on a device can be massively slower -- Brad Fitzpatrick, at last week's Google I|O 2010 conference, cited spikes of up to 200ms to write a single byte to flash. And, the combination of Android, flash, and the yaffs2 filesystem apparently causes a device to get progressively slower at flash I/O as the flash fills up. Hence, his recommendation was to do any flash writes in a background thread instead of the main application thread, where it can tie up the UI and lead to a "janky" app.

(apparently, "janky" is a technical term... :-)

BTW, when it shows up online, definitely watch Brad's presentation on YouTube. It may be a bit difficult to follow at times, because he spoke very quickly, but it was full of useful tidbits related to performance.

like image 161
CommonsWare Avatar answered Oct 05 '22 12:10

CommonsWare