Runs fine in Corona Simulator but painfully slow in Xcode Simulator???

Anyone else had this problem. My app runs fine in Corona Sim and on device but if I build for Xcode Sim then it runs horribly??

I haven’t built for xCode before and only did so to take screen shots (thinking it would be easy) but now should I be worried?

Many thanks,

J [import]uid: 26289 topic_id: 31908 reply_id: 331908[/import]

Hi, we also experience performance issues with the XCode sim… I don’t think that should worry you. All our games run just fine on actual devices.

The big difference is that Corona Sim is a just a native lua host that implements all the API in native OpenGL calls and runs by itself in a native app, if anything I would expect the Sim to be faster than any mobile device because PCs usually have stronger hardware.

The XCode simulator actually loads a virtual machine with the actual iOS rom, this process includes emulating all the iPhone hardware on your PC. This emulation is very slow because the PC hardware is very different.
For instance The CPU on iPhone uses the ARM instruction set while PCs use x86 (intel).
Just passing all direct CPU instructions through a software emulating layer is very very slow…
I’m sure other aspects of the hardware are completely different but I’m not really an expert…

So to sum this up. I think you will always experience much slower performance if running in a full emulation simulator (be it XCode / Android or Kindle simulators the vendors provide).

Still, these simulators are a very important testing stage before releasing the game because:

  1. You will spot issues you cannot spot in the Corona sim because some API calls are not supported in the Corona native Simulator, or theyperform differently than on an actual device. Some examples are the soft menu buttons on kindle fire, testing hardware buttons on android, testing your app supports iPhone 5 tall mode, and more…

  2. You can make sure your game runs on devices you do not have available for testing.

  3. It’s very easy to create screenshots directly from the XCode sim for all the resolutions required by apple for submission of the app.

  4. Testing your game doesn’t consume too much texture memory. The Corona sim will allow you much more than any mobile device. We had once a prototype that worked flawless on the Corona sim but crashed on startup on any device we tried :slight_smile:
    [import]uid: 80469 topic_id: 31908 reply_id: 127340[/import]

Thanks for responding gtt.

I had hoped as much and it is a relief to know. The only thing that still concerns me is the iPhone 5 tall mode.

In Corona simulator everything seems fine with the iPhone 5 skin but I get the two black bars in xCode. Unfortunately I don’t have a device to test on (I’ve been looking).

My config settings are letterbox w 320x480 and the images are 360x570 plus they have the correct bleed area. I thought this wouldn’t be a problem.

Any ideas? Should I ignore the xCode sim or is it showing correctly?

Big thanks [import]uid: 26289 topic_id: 31908 reply_id: 127342[/import]

Hi, we also experience performance issues with the XCode sim… I don’t think that should worry you. All our games run just fine on actual devices.

The big difference is that Corona Sim is a just a native lua host that implements all the API in native OpenGL calls and runs by itself in a native app, if anything I would expect the Sim to be faster than any mobile device because PCs usually have stronger hardware.

The XCode simulator actually loads a virtual machine with the actual iOS rom, this process includes emulating all the iPhone hardware on your PC. This emulation is very slow because the PC hardware is very different.
For instance The CPU on iPhone uses the ARM instruction set while PCs use x86 (intel).
Just passing all direct CPU instructions through a software emulating layer is very very slow…
I’m sure other aspects of the hardware are completely different but I’m not really an expert…

So to sum this up. I think you will always experience much slower performance if running in a full emulation simulator (be it XCode / Android or Kindle simulators the vendors provide).

Still, these simulators are a very important testing stage before releasing the game because:

  1. You will spot issues you cannot spot in the Corona sim because some API calls are not supported in the Corona native Simulator, or theyperform differently than on an actual device. Some examples are the soft menu buttons on kindle fire, testing hardware buttons on android, testing your app supports iPhone 5 tall mode, and more…

  2. You can make sure your game runs on devices you do not have available for testing.

  3. It’s very easy to create screenshots directly from the XCode sim for all the resolutions required by apple for submission of the app.

  4. Testing your game doesn’t consume too much texture memory. The Corona sim will allow you much more than any mobile device. We had once a prototype that worked flawless on the Corona sim but crashed on startup on any device we tried :slight_smile:
    [import]uid: 80469 topic_id: 31908 reply_id: 127340[/import]

Thanks for responding gtt.

I had hoped as much and it is a relief to know. The only thing that still concerns me is the iPhone 5 tall mode.

In Corona simulator everything seems fine with the iPhone 5 skin but I get the two black bars in xCode. Unfortunately I don’t have a device to test on (I’ve been looking).

My config settings are letterbox w 320x480 and the images are 360x570 plus they have the correct bleed area. I thought this wouldn’t be a problem.

Any ideas? Should I ignore the xCode sim or is it showing correctly?

Big thanks [import]uid: 26289 topic_id: 31908 reply_id: 127342[/import]

I would be interested in a response from Corona on this question of XCode sim vs Corona Sim. The thing that worries me is that the game runs fine on non-physics screens, but it is the physics level that is running at very slow framerates. The question to Corona is this: Do you expect this? If not, where could I be going wrong with physics? Maybe I have things turned up too high in my level? Or maybe I am doing too much inside my event handlers?

Like gtt above, my game runs fine on the device, but crawls on the xcode sim. I used xcode sim to test my iAds implementation, and so this is why I noticed the trouble. In the past, I have always seen xcodes sim to run very accurately to the device, so I worry about this.

Regards,

Paul Christensen

Tamarac Apps 

The Xcode Simulator is just that, a simulation of a mobile device running on the desktop.  As such it makes compromises between the accuracy of the simulation and things like speed and memory usage.  Its performance is also completely dependent on the hardware you are running it on and how busy that is (and other things like which graphics processor you have enabled on certain MacBook Pros).

I don’t see any difference running our Sample physics apps on the Xcode Simulator though I’ll grant that these are not especially complex.  The test that matters is running your app on an actual device.

I would be interested in a response from Corona on this question of XCode sim vs Corona Sim. The thing that worries me is that the game runs fine on non-physics screens, but it is the physics level that is running at very slow framerates. The question to Corona is this: Do you expect this? If not, where could I be going wrong with physics? Maybe I have things turned up too high in my level? Or maybe I am doing too much inside my event handlers?

Like gtt above, my game runs fine on the device, but crawls on the xcode sim. I used xcode sim to test my iAds implementation, and so this is why I noticed the trouble. In the past, I have always seen xcodes sim to run very accurately to the device, so I worry about this.

Regards,

Paul Christensen

Tamarac Apps 

The Xcode Simulator is just that, a simulation of a mobile device running on the desktop.  As such it makes compromises between the accuracy of the simulation and things like speed and memory usage.  Its performance is also completely dependent on the hardware you are running it on and how busy that is (and other things like which graphics processor you have enabled on certain MacBook Pros).

I don’t see any difference running our Sample physics apps on the Xcode Simulator though I’ll grant that these are not especially complex.  The test that matters is running your app on an actual device.