Our studio was developing a slot project in Cocos2d using Spritebuilder, however with the latest features available in Sprite-Kit we have decided to convert this ongoing project to Sprite-Kit.
We are experiencing some performance issues with deep scene graphs where the CPU usage seems to escalate and cause a drop in frames. At first I thought it was something in our code but I was able to recreate the problem starting from a blank Sprite-Kit template project. I have added a link to the sample project.
Sample Project Link: https://dl.dropboxusercontent.com/u/966509/test2.zip
My scene graph is as follows and uses reference nodes to create the scene graph depth:
GameScene -> GameView -> SlotView -> Reel -> TileContainer -> Tile. I should note that there are 5 reels in the scene and each reel contains 5 tiles. This totals out at around 50-60 nodes at a depth of about 6 in the tree graph. I believe most of the nodes are skspritenodes. My actual project has a deeper tree graph and the performance is even worse. However, using the test project you can easily add 100's of sprites to the screen by tapping without a drop in performance. This leads to my conclusion that the performance is related to nested nodes and deep scene graphs. Or it could be related to the use of reference nodes.
I am testing on an iPad 3 with ios9 beta 2. I see frames drop into the 45-50 fps range with this scene graph. The same scene graph performed at 60 fps with cocos2d.
My question is: Is this a limitation of Sprite-Kit where I need to rearchitect to make sure we don't have a deep scene graph? Or is this simply beta performance and we can expect improvement with the final release?
Also the flag to show draw count and node count doesn't appear to work in the beta.