v3.7 speed compared with 3.6

Until the figures get really low (5 fps) both seem to agree - it’s only the really low figures where the IOS screen shows higher FPS than reality s far as I can tell

As mentioned above, I created a brand new, empty project from both 3.6 and 3.7 - the figures above are from that - so just the basic, almost empty project with a single large sprite of the cocos2d-x logo

This is what’s confusing me. There was definite degradation on the iPad 1 and iPhone 5C but not on the others

Me too, although my game is only half completed, I’ve never seen anything less than 60FPS, however my minimum testing device is a 1st gen Nexus 7.

Are you using the splash screen?
Is the sprite you are adding the 480x320 splash screen?
Are you scaling the sprite?
Would be helpful if you could share the helloWorld scene code.

It’s the helloworld code from the default project you create when you set up a new project in cocos2d-x, with the change I showed in a post above

for (int i = 0;i<100;i++)
    {
        auto sprite = Sprite::create("HelloWorld.png");

        // position the sprite on the center of the screen
        sprite->setPosition(Vec2(i, visibleSize.height/2 + origin.y));

        // add the sprite as a child to this layer
        this->addChild(sprite, 0);
    }

as the only change - so the sprite is “HelloWorld.png” - I’ve just put the loop around it to display the same sprite many times.

Cheers

@Maxxx, sorry, somehow I missed the code you posted before.

I too am seeing that Cocos2d-x 3.7 does suffer on iPad 1.
From what I measured, its performance on 3.7 is worse than on 3.5 when running on iPad 1. Didn’t have 3.6 readily available to test.

Using your code I did changed the sprites to 120x80 to get a more realistic game sprite size. A mobile game probably should not expect to have much more than ten 480x320 or larger sprites and still see 60fps on older devices like the iPad 1.

On iPad 1 with 3.7 rc0
With one hundred 320x480 sprites I get about 13 fps.
Change the sprite to 120x80 and I get:
100 sprites -> 60fps
250 sprites -> 35 fps
500 sprites -> 23 fps

On iPad 1 with Cocos2d-x 3.5
100 sprites -> 60fps
250 sprites -> 54 fps
500 sprites -> 31 fps

iPhone 4 and Cocos2d-x 3.7rc0
100 sprites -> 60fps
250 sprites -> 60fps
500 sprites -> 35fps

iPhone 4 and Cocos2d-x 3.5
100 sprites -> 60fps
250 sprites -> 60fps
500 sprites -> 32fps

iPhone 5 Cocos2d-x 3.7rc0
100 sprites -> 60fps
250 sprites -> 60fps
500 sprites -> 60fps
750 sprites -> 60fps
1000 sprites -> 60fps
1250 sprites -> 60fps
2500 sprites -> 60fps
5000 sprites -> 60fps
25000 sprites -> 20fps
50000 sprites -> 10fps
100000 sprites -> 6.5fps

These large numbers are probably getting “relatively high” fps that they are because the sprite overlap and many sprites are off the screen and probably not drawn.

This is probably to be expected on an older device. But maybe Cocos2d-x is catering to newer devices with the newer releases… not sure.

On a side note, have you tried running the cocos2d-x/build/cocos2d_tests.xcodeproj on those devices?
The cpp-tests iOS target and the test called Performance Tests -> Spite Perf Test. That test adds sprites in increments of 250. The sprites that are added are about 52x139 in size. The fps when running some of these tests is very low on iPad 1.

About 6 months ago I decided to stop supporting iPad 1 due to libraries that I use that require iOS >= 6.

Interesting - it does look as if 3.7 is a better or equal performer except on iPad1 - which was the feeling I was getting until I got some weird results on the iPhone 4 but I now think that is just because the device-displayed figures were incorrect at very slow frame rates.

My game suffers badly on the iPad 1 because I have a lot of drawing to the screen (for terrain) which slows it down, but I have always used the iPad 1 as my benchmark - if it runs on that it will run on almost anything!

So I am disappointed that it looks like I too will need to ditch support for it if I want to keep up with cocos2d-X releases - which I do because I am waiting for better sound support!

I told you! Disable Sprite Clipping/Culling and Lua Binding, witch are enabled by default in cocos2d-x 3.7, unlike cocos2d-x 3.6 and you will see the same performance!
You will find those parameters in a header file named ccConfig.h.

I looked in ccConfig.h
The only references to LUA or Culling in there are identical in both v3.6 and V3.7 - in fact except for some 3D mesh settings, I think both files are identical…

So exactly what is it you say is different between the two?

Try replace “TrianglesCommand” to “QuadCommand” in CCSprite
When i use QuadCommand to render, the performance is better than TrianglesCommand.

Maybe we can use QuadCommand when we don’t use PolygonInfo.

BTW, cocos2d-x 3.6 use QuadCommand.

does cocos team Aware of this ? iPhone 4 is still very important to support .
allot of users still using iPhone 4.

This seems to show that the iPhone 4 isn’t affected very much at all…

1 Like

I made an issue for this on GitHub:

performance issues ipad1 and iphone4

Thanks everyone.
@Maxxx
It is curious that the performance degeneration is so high. Could you post a test case for the performance?
In version 3.7, there are some changes to sprite rendering.

  1. using TrianglesCommand, which is slightly slow than QuadCommand when we render a quad. (about 3%)
  2. using TrianglesInfo for rendering.

These two changes are made because in most cases, using a quad for rendering will waste two many pixel fill rates, which is a bottleneck, especially for large sprites. But in the contrary, it means more vertices is processed if we triangulate the sprite into triangles.

I just used the bare project created using the cocos command, with the changes noted below…

Thanks, We will continue to test overall performance for the next v3.8 version.
But I have tested A(9) and F(9) on Iphone 5s, and I found the performance is similar.
Could you try it?

BTW: Hello.png is a big sprite, which means the pixel fill rate will achieve the bottleneck more easily. Which will also affect the FPS.

Sorry - I’m not sure what you mean by A(9) and F(9)?

Hi, There is a performance test in cpp-tests
cpp-tests->Performance Test->Sprite perf test.

It can test the performance of sprite, including rendering, actions etc.

We tested the performance of V3.8 against V3.5,

  1. the rendering performance is very similar.
  2. camera culling is used, which is slower but in our anticipation.
    Here is the testing result.