30

Diving into sprite kit (xcode 5). There are two example programs I'm working with, 1. the default spaceship example that's included when creating a new project and 2. the Adventure Game, which I downloaded.

Running these examples within the iOS Simulator (doesn't seem to matter which). The frame rate for each is absolutely abysmal. If I add only 30 spinning space ships in the space ship / hello world example, the FR rapidly drops from 60 FPS to (ug) 12 FPS.

The Adventure Game example, again, running in iOS Sim, runs at a screaming 10-20 FPS (depending on how much action is going on).

Is Apple serious with these game examples? Sprite Kit seems to be crap -- I assume the problem is either the way the programmers employed Texture Atlas' or it's the way Sprite Kit (API) is dealing with them.

Someone help me understand this or fix it?

Running xcode 5 under Mavericks, Mac Mini -- I program in Unity3D and have no problems w/ FR there, esp w/ only 30 objects using 2DToolkit.

7
  • 1
    when you run the demo code on the device, the frame rate is fine. Running 4S and have 40 spinning ships at 60 fps. But on the simulator - the FPS is poor ... a few ships and down to 12 or so..
    – DogCoffee
    Commented Oct 24, 2013 at 4:37
  • well, glad it's not just me. wonder if there's a Build Setting I can change, been playing around and so far, no luck. i gather from what i see, the Sim isn't taking advantage of my system's local GPU, that what it looks like anyway, could be something else.
    – user1068477
    Commented Oct 24, 2013 at 4:41
  • Looks like this might be related: stackoverflow.com/questions/1461245/…
    – user1068477
    Commented Oct 24, 2013 at 4:44
  • 1
    yeah, i only worry about performance when running on device. so far no issues with FPS.
    – DogCoffee
    Commented Oct 24, 2013 at 6:17
  • 1
    @YumeApps I suggest asking a question on stack, if the bullets don't have physics bodies attached I'm thinking it should be ok. But, just have to try and see. OpenGL is something I've never used, give Sprite Kit a go - sounds like a fun game :) Good luck
    – DogCoffee
    Commented Dec 17, 2014 at 11:09

2 Answers 2

79

The Simulator is not a device. The Simulator uses the Mac's CPU (tons faster) and the Mac's memory (lots more). However the Simulator also emulates OpenGL ES via a software renderer, which is abysmally slow even on the fastest CPU.

Because of this and the fact that no end user will ever run an app on the Simulator, any performance measurements on the Simulator are utterly IRRELEVANT!

Sorry for shouting but I felt this needed to be said with conviction. ;)

10
  • 3
    This issue is also not specific to SpriteKit. Unity, cocos2D, Sparrow etc all run slower on IOS simulator, even abysmal. Commented Oct 24, 2013 at 19:56
  • 3
    Yep. For anything you do with OpenGL ES, the iOS Simulator is not an accurate performance measure.
    – rickster
    Commented Oct 24, 2013 at 22:11
  • 3
    For anything, period. ;)
    – CodeSmile
    Commented Oct 24, 2013 at 22:37
  • 2
    Over 3 years later now and apparently still no improvement. I'm also seeing ridiculously low fps with SpriteKit in the simulator. sigh Commented Jan 14, 2017 at 21:58
  • 1
    IRRELEVANT? Yes off course, we should not consider run time of some code in simulator as time in real device. But we can compare times between simulator and real device to find out that simulator has some serious performance issues. I have demonstrated that Simulator is 200 times slower than real device. Simulator is not usable at all in that demo code. See my answer here stackoverflow.com/a/59625897/3826175 Btw @JamesPaulMason updating... Over 6 years later now and apparently still no improvement. I think that simulator is slower and slower with each newer Xcode and iOS releases.
    – mikep
    Commented Jan 7, 2020 at 9:56
3

Even though this post is almost 8 years old I found myself in the same situation when trying to record an App Store preview for my Unity game.

With your simulator open you can change the GPU Selection to improve performance. It was set to Automatic for me and changing it to Prefer Discrete GPU dramatically improved the frame rate.

screenshot

Notes

  • Tested with Xcode 12.5 - not sure when this feature was introduced.
  • I had to restart the simulator for it to take effect.
  • Your Mac will presumably need to have a discrete GPU in the first place (mine is a 15" MacBook Pro).
1
  • This worked perfectly for me on a 15" 2019 MBP. Prior to enabling this the iOS simulator was running the worst I've ever seen, but changing it to this has made it run smooth as butter. Thanks for posting this!
    – Aron
    Commented Sep 12, 2021 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.