cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
7.17k stars 1.83k forks source link

The same 3D scene 3.8.3 takes up 90MB more memory than Unity 2021 #17039

Open jordiwang opened 4 months ago

jordiwang commented 4 months ago

Use Case

Use default settings for everything, The same 3D scene 3.8.3 takes up more memory than Unity

Problem Description

image

Proposed Solution

No response

How it works

https://share.weiyun.com/14O8zNAF

Alternatives Considered

Can analyze and compare the specific differences in memory usage?

Additional Information

No response

minggo commented 4 months ago

Did you test in release mode?

jordiwang commented 4 months ago

Did you test in release mode?

yes, build android release apk, code is here https://share.weiyun.com/14O8zNAF

minggo commented 4 months ago

May be you can try to improve it by:

jordiwang commented 4 months ago

Is there an official demo for performance comparison testing?

minggo commented 4 months ago

No, we will not provide demoes for this type of comparison.

jordiwang commented 4 months ago

May be you can try to improve it by:

  • use opengl es instead of vulkan
  • disable multi-thread rendering in GFXDeviceManager.h
  • don't trigger Allow Data Access if the mesh is a static mesh, which means the mesh will not be used again after sending data to GPU
  • don't include modules that are not needed in your game
image

After disabling multithreading and taking the above measures, there is still about 60MB more, are there any other measures?

minggo commented 4 months ago

Did you disable not needed features, such as physics.

jordiwang commented 4 months ago
image image image

After disable not needed features, the memory is still 50MB larger than unity 2021

are there any other measures?

smallmain commented 4 months ago

Hey, at least the CPU won! Double! 🤩

jordiwang commented 4 months ago

Hahahaha That's a difficult trade-off.