cocos2d-x icon indicating copy to clipboard operation
cocos2d-x copied to clipboard

cocos2d-x v4.0 Performance issue on Android vs 3.17.1

Open SeptemHuang opened this issue 3 years ago • 5 comments

  • cocos2d-x version: v4.0、v3.17
  • devices test on: HUAWEI P20
  • developing environments
  • NDK version: 16b

Steps to Reproduce:

  1. add sprite and label x 1000 in scene let the draw call reach 1000 more
  2. run or not runAction is no different

v4 fps much lower than v3.17

video link: v4 https://imgur.com/Eu2EHsH

v3.17 https://imgur.com/rGtFuQ6

SeptemHuang avatar May 18 '21 09:05 SeptemHuang

Could you attach code to reproduce an issue?

mariusz102102 avatar May 20 '21 21:05 mariusz102102

Could you attach code to reproduce an issue?

here

auto scene = Scene::create();
auto layer = Layer::create();
layer->setPosition(Director::getInstance()->getVisibleOrigin());
scene->addChild(layer);

auto visibleSize = Director::getInstance()->getVisibleSize();


for (int i=0 ; i<3000 ; i++)
{

    Sprite *sprite = Sprite::createWithSpriteFrameName("test.png");
    sprite->setPosition(Vec2(random(0, (int)visibleSize.width), random(0, (int)visibleSize.height)));
    sprite->setScale(0.5);
    layer->addChild(sprite);

    Label *label = Label::createWithSystemFont(StringUtils::format("%d", i), "Arial", 15);
    sprite->addChild(label);
}


Director::getInstance()->runWithScene(scene);

Yehsam23 avatar May 21 '21 01:05 Yehsam23

Yeah, the code is some thing just like that Make the draw call higher will easier to see the fps drop in v4

Could you attach code to reproduce an issue?

here

auto scene = Scene::create();
auto layer = Layer::create();
layer->setPosition(Director::getInstance()->getVisibleOrigin());
scene->addChild(layer);

auto visibleSize = Director::getInstance()->getVisibleSize();


for (int i=0 ; i<3000 ; i++)
{

    Sprite *sprite = Sprite::createWithSpriteFrameName("test.png");
    sprite->setPosition(Vec2(random(0, (int)visibleSize.width), random(0, (int)visibleSize.height)));
    sprite->setScale(0.5);
    layer->addChild(sprite);

    Label *label = Label::createWithSystemFont(StringUtils::format("%d", i), "Arial", 15);
    sprite->addChild(label);
}


Director::getInstance()->runWithScene(scene);

SeptemHuang avatar May 21 '21 02:05 SeptemHuang

any progress here?

studio501 avatar Oct 20 '21 03:10 studio501

any progress here?

No, I start to doubt the cocos2d team was gave up to maintain cocos2dx.

SeptemHuang avatar Oct 20 '21 06:10 SeptemHuang

any progress here?

No, I start to doubt the cocos2d team was gave up to maintain cocos2dx. you maybe right, the official team has given up the cocos2dx project, it is a pity

tashaxing avatar Nov 24 '21 13:11 tashaxing