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

构建后Web项目的引擎体积

Open a1076559139 opened this issue 1 year ago • 0 comments

Use Case

我主要的工作是开发Web端的营销类游戏,这类游戏对启动速度比较敏感。

Problem Description

3.8.0开始,引擎的体积因为spine的调整呈爆炸式的增长: System.import('cc')加载的_virtual_cc.js将近800K(gzip后)我这仅仅是2D游戏,而且已经裁剪了不需要的功能。 这还不算完,运行cc.game.run()后,又加载了将近700K(gzip后)的spine库文件,还有110K(gzip后)的internal文件(我没有用到shader等高级功能)。

在我们的性能统计中,90分位数据: System.import('cc') 耗时3秒左右 cc.game.run() 耗时5.5秒左右

Proposed Solution

No response

How it works

No response

Alternatives Considered

我觉得spine的体积可以减小,最好引擎可以支持Treeshake,或者将功能裁剪功能做的更好

Additional Information

No response

a1076559139 avatar Jan 31 '24 09:01 a1076559139