Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Speed of program in iPhone simulator

How does the speed of a program when run in the simulator compare to a real iPhone or Ipod touch? Is it faster or slower?

like image 910
node ninja Avatar asked Dec 21 '22 22:12

node ninja


1 Answers

iPhone simulator is simulator. It doesn't emulate real hardware, just mimics its behavior. In fact, apps compiled for simulator are just x86 binaries executed on Mac OS X machine directly. So it fully utilizes all processing power and network bandwidth of the development machine.

You can assume you're running regular Mac OS X app. In fact, it is. This is the answer for why we can't run iOS app in iOS simulator. You need compiled binary for x86. However, with this approach, you can't get exactly same behavior with real device.

Basic UIKit graphics are very fast because it's simulated on top of OS X's Quartz which is hardware accelerated, but the OpenGL ES context is an exception. It's really slow. Even it's a simulator, the simulator emulates OpenGL ES with software renderer to display correct result. It doesn't use hardware accelerations.


Android emulator is an emulator. It's essentially a VM emulates all of target machine behaviors, so it is far more slower than iPhone simulator. But it can behave exactly same with real device. You can even run Android app from Android market on Android emulator directly.

However there is some gotchas. There're so many Android hardware, but emulator only emulates a part of them. Google's implementation. If your device have its own special module, of course, it cannot be emulated. It's possible using some kind of emulator plugin from each hardware vendors, but as I know, almost no vendor offers it.


So, iPhone simulator is always a lot faster than real device. And Android emulator never been faster than real device even it had become a lot faster than initial release.

like image 65
eonil Avatar answered Jan 08 '23 14:01

eonil