Performance tests and comparison of cocos2d-x-3.2 and cocos2d-js-3.0

Performance tests and comparison of cocos2d-x-3.2 and cocos2d-js-3.0
0

I am deciding which engine should use to make my new games so I did some performance tests.
Simple rotating sprites on Samsung Galaxy Note 2 (Android 4.4)

Cocos2d-js-3.0

FPS | ANIMATED SPRITES
60 - 140
58 - 150
40 - 200
28 - 300
20 - 400
16 - 500
13 - 600
8 - 1000

Cocos2d-x-3.2

FPS | ANIMATED SPRITES
60 - 100
50 - 120
40 - 150
lol?
22 - 300
19 - 400
17 - 500
17 - 600
17 - 1000

Could you explain this?
Now I see pros and cons of these cocos2d branches:

Cocos2d-x pros:

  • only 2.8MB size of clean app
  • better support for IAP, AdMob and other 3rd party libs
  • better performance (I thought)
  • more platforms

Cocos2d-x cons:

  • slower debugging
  • cpp is less friendly language

Cocos2d-js pros:

  • better and faster debugging
  • javascript is more friendly language
  • run on browsers

Cocos2d-js cons:

  • around 6.5MB size of clean app
  • poor support for IAP, AdMob and other 3rd party libs

Could you tell me guys which “branch” is better for professional development with all features including IAP, physics engine, best performance and low app size?
Best regards,

1 Like

Really? I think that’s down to personal preference!

But - those figures! I find it astonishing if JS is faster than C++

Although - thinking about it, you’re only measuring graphic performance here - waht about game logic? That will surely be slower with JS

1 Like

Hi, i think this is an good idea to compare performance between cocos2d-x c++/js/lua. Evidently, c++ is better in performance, but if it only ~20% better, which can only be regconized easily in some big game, then lua/js is another good option when there is now a cocos IDE

Although - thinking about it, you’re only measuring graphic performance here - waht about game logic?

What do you mean with ‘game logic’ exactly? Physics engine for example or sth?

1 Like

What I was getting at is that a straight test of rendering 100 sprites doesn’t take into account that, in a real game, there will be processing going on to move those sprites around, detect collisions, update scores, - the game logic is what ‘drives’ the game.

Yeah, right, but my simple tests get us some point of view on performance differences between cpp and js branches. Could anyone of you make your tests too to compare with mine?

cpp does not have garbage collection, which often hampers the performance in a real application where you dynamically allocate memory at runtime.

Anyway, if you are wondering about which branch to use for professional development, if cocos2d-x-js is lagging already 2 versions behind, the choice should be simple, given that you are familiar with c++.

I also get low fps on android device
but pc works well

What is the root cause ?

Can I optimize that?

I think you should compile you project in release mode and disable both lua binding and physics from “ccConfig.h” file, and you will see a HUGE difference between the first test and the second…

1 Like