cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

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

Open jordiwang opened this issue 1 year ago • 10 comments

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

jordiwang avatar May 23 '24 09:05 jordiwang

Did you test in release mode?

minggo avatar May 24 '24 03:05 minggo

Did you test in release mode?

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

jordiwang avatar May 24 '24 06:05 jordiwang

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

minggo avatar May 24 '24 06:05 minggo

Is there an official demo for performance comparison testing?

jordiwang avatar May 24 '24 07:05 jordiwang

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

minggo avatar May 24 '24 08:05 minggo

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?

jordiwang avatar Jun 04 '24 12:06 jordiwang

Did you disable not needed features, such as physics.

minggo avatar Jun 05 '24 02:06 minggo

image image image

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

are there any other measures?

jordiwang avatar Jun 05 '24 08:06 jordiwang

Hey, at least the CPU won! Double! 🤩

smallmain avatar Jun 05 '24 08:06 smallmain

Hahahaha That's a difficult trade-off.

jordiwang avatar Jun 05 '24 09:06 jordiwang