Cocos2d-2.0-x running slow on build

Cocos2d-2.0-x running slow on build
0.0 0


Hello everybody!
First, I’d like to thank you for the great library you’ve made. It’s really fun to develop with!

I’m having a problem with my first project on BlackBerry 10.
The project itself is very simple: there’s a full screen background image, a CCLayerColor whose color is progressively changed by a CCTintTo action and a sprite whose position is periodically updated by the update(float dt) method.
With every previous build of BB10 it used to run at nearly 60 FPS all the time; however I’m experiencing serious and unexplained slowdowns with the latest gold build
The code base is exactly the same as before - no line of code was changed - but the FPS has now dropped to an average of 35-40 FPS, with occasional peaks of 45 FPS.

At first I thought there was something wrong with my code, but some clues tell me that it’s not the case:

  • The FPS is only marginally influenced by the actual code being run: even if I comment out everything and I only display a black screen and the FPS, it’s not going any faster than 40-45 FPS.
  • All the example project included (“HelloLua”, “HelloCpp” and “TestCpp”) experience the same slowdown effect.
  • I ported the “SimpleGame” example from the android release: this also used to run at 60 FPS on build, but it’s now running at 30-35 FPS on with noticeable jittering in animations.

I’m running the latest stable release, cocos2d-2.0-x-2.0.4.

Do you know if there is any particular reason behind this odd behavior? Is anyone experiencing the same results?

Sherry Haibara


I am sorry about that.
We will try our best to find out the reason.
Thank you for your feedback.


What’s the cocos2d-x version that runs 60 FPS on BB 10?


The very same build cocos2d-2.0-x-2.0.4.
I haven’t tested the 2.1 beta neither on BB10.0.9.1103 nor on BB10.0.9.1675.

I recompiled the projects using the latest beta build cocos2d-2.0-x-2.1-beta3. I’m now getting a more than reasonable framerate of about 55-60 FPS, which would apparently mean the problem fixed itself.
I can’t figure out what’s changed, though: is there any substantial modification to the way the core of cocos2d-x operates in 2.1beta?
If not, then it could be a simple recompile problem: perhaps RIM has changed some APIs used by cocos2d in order to render its scenes and for some odd reason the Momentics IDE wasn’t recompiling the library in the correct way.

To be sure of the results, I ran a couple of different projects and I’m seeing consistent behavior: my project went up to 55-60 FPS from 40-45, and SimpleGame rose from 30-35FPS to 45-50 FPS.