SpriteKit Perfomance

I noticed some performance issues with SpriteKit on iOS 9 beta 5 (at least on older devices).


My code on iOS 8.x runs at 60 FPS, but on iOS 9 beta 5 runs at ~30 FPS.

On the previous iOS 9 betas, the code ran at 60 FPS.


Does anybody else have the same issues?


My development devices are an iPad (4th generation) and an iPhone 4S. I don't have a newer device to test on.


Thanks,

Josh

Issue is not resolved for me with the iOS 9 GM. I am in the middle of delveloping a game in SpriteKit and recently updated to Xcode 7 and Swift 2.0. After the conversion, I was still testing on an 8.4 device and everything continued running at a silky smooth 60fps. Updated to iOS 9.0 today on my personal device and the framerate dropped to an absolutely unplayble 32-36 fps. Dramatic. Same build off of Xcode 7 to iOS 8.x works perfectly. I would not even know where to start as my game is quite optimized. I can safely say there is nothing I could do to get 28fps back. This is a serious issue with iOS9 and Spritekit.


I submitted a bug report immediately.


22734796


This has stopped my development in its tracks.

Please file bug reports about the specific issues you are seeing, include focused sample projects with the bug reports and then post the bug report numbers to the forums.

I too was having performance woes with SpriteKit and after a lot of digging found that most of my performance issues were coming from the use of SKCropNodes. As soon as I set the maskNode property on an instance of a cropnode and added children to it my performance greatly decreased. I filed a bug report for this. Hopefully this is useful info for some of you that are seeing large frame rate drops as well.


Bug Number:


22649710

Having the same performance problems as well, FPS went from solid 55-60 to around 35-40.


Same issue from iOS 7 to 8, back then it was "enumerateChildNodesWithName" that gave performance problems in iOS 8, but it got solved by Apple. For this reason I hope they can solve this one too. I'm not able to pin point the error this time, I'm not using SKCropNodes at all.


Wondering if it relates to the power saving Apple has implemented in iOS 9, giving Spritekit less cycles. Something we as developers just cannot spot.


Added bug report as well

I'm also running into the similar issues.

I believe I've narrowed it down to SKEmitters masked within a SKCropNode in my game.


Running a version on an iPad 2 with iOS 8.4, which runs at 60 fps without any problem.

Ran it pre-update on an iPad Air 2 with iOS 8.4, which also ran at 60 fps without any problems.

Using the same code and the same iPad Air 2, it is running it at 40 fps post-update with just the SKCropNode.

The scary bit is that when the object is used in-game, the iPad Air 2 dropped from a very solid 60 fps to a very unplayable 15 fps.


I was very surprised that my app was effected at all, considering that I didn't notice anything about SKCropNode changes in the documentation in the update.

Hopefully they can figure out the issue.


Added bug report on today (9/21/2015).

Same here.. The scenes were running fine on 60fps in xcode6.4 with ios8 but on ios9 the same code is barely running at 60fps.

For me on loading of view it takes some time for it to come to 60fps

Play a sound along with sprite kit actions and the view drops below 50fps


Its happening on iPhone6plus - So its not a device not having proper juice issue.

Its something intirely else.


But there is one thing they did fix finally ... the RGBA structure of mutable textures is now indeed RGBA before it was BGRA.. but now I need to have a iOS check before settings the texture RGBA.

Hi everyone,

Just a bit of an update about something that most of you probably know to do already anyway.


I found that NOT using xScale & yScale made a difference in frame rate.

By using an actual size mask graphics for the CropNode and everything contained within it, I got about a 10 fps increase.

It is still lower than before the update, but closer to gameplay functional.


Hope this helps.


Hopefully they'll solve the issue with the masking soon for the upcoming patch.

Same here! Scenes ran buttery-smooth (60fps average on the A5X and upwards) on iOS 8.x.

Since iOS 9.0 (and 9.0.1 for that matter), this simply isn't the case.


For our current project, even the A9 produces drastic drops from 60 fps to ~15 fps (notably after pausing a SKScene, and dismissing a pause view). This drop in performance persists for anywhere between 10 and 30 seconds, before randomly returning to rendering at 60 fps. Current apps in the app store are showing terrible performance in general - no pausing of the active scenes required.


Writing up a comprehensive bug report w/ sample projects now.



This is really obfuscating our team's development process. Looking forward to a fix.

I'm getting radnomly 60fps or 40fps on my iPad Mini 4 using Xcode 7.0.1 and running iOS 9.0.2. It just seems sometiems I start the app it's at 60fps, and sometimes it runs at 40fps.

This problem is apparent in SceneKit, too.


And Metal.


So... who is going to be the first to get an answer from Apple as to why this is happening, and when it's going to be fixed?

If Apple marks your bug as a duplicate (very likely in this case), they'll give you the bug number it's a duplicate of. So you can use that to match up to those posted here or on OpenRadar.

The same is happening to me, using a SceneKit project and testing in a iPhone 6 (xcode 7.0.1, ios 9.0.1). When moving to the GameScene, it randomly starts and stays at 60 or 40 fps. I'm seriously worried with this problem, hope there's a fix soon.

This is exactly what happens to me. I've been able to work around most cases by pausing the SKView and not the SKScene. This fixed the issue in my game when a user paused or left the app. However if the user dies and start again, it still randomly goes to 40fps. Pausing and unpausing brings it back up to 60fps.


The instance where the user dies, I used to have logic to reset the scene. I tried switching my logic to recreate the scene every time, and it still can randomly drop and get capped at 40fps.


Its hard to say, but there seems to be issues with the physics engine running while a UIView animation is happening. For instance we have a view on top of the game scene. If I unpause the game and start an animation to alpha out the over top view at same time, it drops to 40fps randomly. If I wait to unpause until after the animation, it never seems to drop to 40 fps.


I also know my trick of pausing and unpausing to get the fps to jump back up to 60 does not work if I only pause and immedately unpause the SKView. However if I let my pause view aniamte in and out between pausing and unpausing the SKView, it's fine and comes back up to 60fps.


TL;DR - try to only pause/unpause on the SKView level and do not animate via UIView at the same time the pause toggle to NO happens. These seemed to do the trick for me.


Edit: Still seems to drop to 40fps randomly, though the amount of times it happens is significantly less. Least I can continue to develop until Apple gets a fix out.

Anyone got any reply from Apple about the bad performance of SpriteKit under iOS 9 ??

(in the bug reporting tool)


I've installed 9.0.2 on my device, but it made no difference, performance is still much worse compared to iOS 8.

My scene is very simple, around 90 nodes (20 physic objects), it is quite obvious that something is “broken” in SpriteKit.

YES!


Seperating my pausing of the SKView, from my UIView dismissal of the pause view worked!

Before, after having unpaused (setting SKView.paused = false and dismissing a pause screen with UIView transformstion animations) I found a sudden, inexplicable drop from 60 fps to ~15 fps.


Only found this to be the case on the actual devices (We've tested from A5X and up), not in the simulator.


Simply put, I've slotted in a countdown interface after my pause menu was dismissed - this gives a player a few seconds to prepare, and, neutralizes the fps drop.

SpriteKit Perfomance
 
 
Q