BunnyMark poor performance?

Sorry, i still can not download it, the error says:

An error occurred while loading MEGA.

The file "lang/cn_9a98d7475fe91952b522aab874a6b73d3eb4545af8ac87bed735cb5abffe7a2f.json" could not be loaded.

Please try again later. We apologize for the inconvenience.

BrowserID: mozilla/5.0 (macintosh; intel mac os x 10_11_4) applewebkit/537.36 (khtml, like gecko) chrome/50.0.2661.102 safari/537.36

Could you please upload it to github?

I added his file to dropbox:

Thanks @energyy. I can download with your link.

Out of interest, how do you normally handle cocos2d projects regarding source control? Do you also check in the ‘cocos2d’ folder containing the engine? I’d like to put this project into a github repo.

I always make example using cpp-empty-test, and create a new branch for it.

Here’s the github link:

The cocos engine is committed as a submodule.

Thanks @nivrig.

My testing result iPhone6(16g) are:

  • without SpriteBatchNode: 4800
  • with SpriteBatchNode: 7600
  • with SpriteBatchNode and disable CC_USE_CULLING: 7700
  • with SpriteBatchNode and disable CC_USE_CULLING, CC_USE_PHYSICS and CC_ENABLE_SCRIPT_BINDING: 7800

I also disable fps labels since the codes calculate it internally. I will try to optimize as i can.

@ricardo Could you please take a look of this thread too?

Can you post your project @zhangxm? I keep getting weird exceptions when I set those flags = 0.

@nivrig:
A few things to mention. As @stevetranby mentioned, SpriteBatchNode is deprecated because, at least for the “normal use case”.

For me, “normal” use case means:

  • in your game you are going to add and remove multiple sprites
  • some of them are not going be outside the viewport, some of them inside

and “rare” use case means:

  • no sprites are being added / removed
  • all of them are inside the viewport

So, Sprite (without SpriteBatchNode) is very fast for the “normal” use case.
And SpriteBatchNode is very fast for the “rare” use case.

Your BunnyMark seems to be optimized for the “rare” use case.

Sorry to keep bothering you with this post @nivrig, but if you have your libGDX main game loop .java code, it’d be fun to try out optimizing both toward equal performance and further improve the “rare” case rendering pipeline.

libGDX code is already on github, have fun!

1 Like

I agree, bunnymark is an edge case, but what I was trying to do was examine the performance of the “normal” way that each engine is used. For cocos this is using Sprite of course. Also, I thought SpriteBatchNode was fully deprecated not just for the normal case, so I didn’t even consider it.

yes, in this case just use Sprite without SpriteBatchNode. A “good” test case would be:

  • have around N sprites inside the viewport
  • have around M sprites outside the viewport
  • and add/remove P sprites every S seconds
  • some of the sprites should be batchable (share the same GL context: texture id, blend mode, shader)

N = ~200
M = ~1000
P = 50
S = 0.3

well, it is fully deprecated in a way. We kept it for backward compatibility… (and for super rare cases).

IIRC, libgdx was faster than cocos2d-x v2. But cocos2d-x v3 is faster than libgdx… Hey, but if it is not, I’ll happily work on improving the performance :smile:

@nivrig I did it in a new CPP project. What’s the error you met?

Thanks @ricardo that’s probably a more realistic model for benchmarking the true performance of games on any particular engine.

I made a new C++ project too, but when I set, for example, CC_USE_PHYSICS=0 in the Xcode preprocessor settings I get the following crash when running on device. This happens in release and debug mode, using v3.11.

ouch. bug. can you add it in the issue tracker? thanks.

Logged Issue #15730

I can’t understand how is that. Libgdx looks like better than cocos2d-x about performance. But I think, cocos2d-x has more advantages for that. Language benchmarks shows us that, usually c++ language is advantageous then other languages (except C and low some low level languages ) And cocos2d-x structure looks like very regular. Am I wrong?