Best way to determine performance issues

Best way to determine performance issues
0.0 0


I am currently trying to optimize my game. I have done all the basics such as making a spritesheet with texturepacker and using the batch node. Pre-loading and pre-initializing elements of my game. However, I still have some performance issues. I was wondering if anyone has any tips or tricks to pinpointing performance issues in general? Are there any tools to make it easier other than trial and error?


First of all, what performances issues are you experiencing? FPS drops? Hiccups?

My first advice in general is to:

  • load the right asset for the right device, that is, do not load a 2048x2048 texture to run as background for an iPhone, build instead a specific resource for that device family and use that (

  • setVisibile(true) to any object which is not on screen: just display and show nodes you actually see

  • setBlendFunc((ccBlendFunc){GL_ONE, GL_ZERO}); to the background if you are using a static image. I actually used this in a real project, incresing drastically the FPS

  • if you are developing for iOS using xCode you can use instruments to run performances tests:
    You can look for memory leaks as well as detect which functions are the most time-expensive in your code. Might turn out that every graphic aspect is taken care of, but some code is poorly written and soaks up time

  • Do not read/write to CCUserDefaults during game updates, might slow down the code. Read once when the game starts and write once when the game ends (or pauses) with as little flush() as possible

Hope this helps! :slight_smile:
Davide Jones

even if this is actually my first post. I’ve been using cocos2dx for the past 2 years. and now I plan to become a more active user!
And please feel free and encouraged to correct me if I wrote everything wrong!


Thanks for all the tips. I’m experiencing a huge jump in render time every 10 frames or so, which is causing screen stuttering. The xcode instruments is actually exactly what I’m looking for, so that I can pinpoint the issues.


Glad I could help :slight_smile:
Let me know if you have further question!

Good luck with your game!