Performance Cocos2d-x vs Cocos2d

Performance Cocos2d-x vs Cocos2d
0.0 0


Personally I’m not very fond of Objective C. Mostly because C*+ is a more widespread language, but I also think that C*+ has potential to be faster.

Whats the current performance status cocos2d vs cocos2d-x? I’ve heard that cocos2d is faster on iOS devices. If so, why?

I guess that function calls in C++ must be faster than the message passing equivalents in Objective C, so why is cocos2d-x slower on iOS devices? That’s what I’ve heard. I’ve heard that it costs to make the code portable. If so, what tradeoffs have been made?

Anyone that have any fresh iOS performance comparisons?


I haven’t tried the non-x version Cocos2d, but in my (soon to be released) Cocos2d-x game which has:

  • a 60x60 tilemap (each tile is a sprite of 32x32 pixels - about 100 tile sprites on screen at one time in the view).
  • box2d collision detection going on (note: just collision detection, not physics, I found the physics runs real slow on older 3G iPhones).
  • about 20 “game” sprites onscreen at any time
  • multiple sample sounds playing.
  • parallax clouds, hills and ground in the background (full screen - more sprites).
  • and I scale in and out (even more tiles on screen when zoomed out).

It runs 60fps on an iPhone 4 and iPad 1. 30 fps on an iPhone 3G. So I’d say go ahead with Cocos2D-X, it’s fast enough.

As for porting to say Android once you’ve finished, if for some reason you can’t used Cocos2d-x on Android, at least your code will be in C++ already so you can used NDK or some other Android dev platform.