cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.16k stars 7.05k forks source link

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

Open SeptemHuang opened 3 years ago

SeptemHuang commented 3 years ago

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

mariusz102102 commented 3 years ago

Could you attach code to reproduce an issue?

SeptemHuang commented 3 years ago

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);
studio501 commented 2 years ago

any progress here?

SeptemHuang commented 2 years ago

any progress here?

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

tashaxing commented 2 years ago

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