Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

包体压缩json建议 #17915

Open
ankye opened this issue Nov 25, 2024 · 4 comments
Open

包体压缩json建议 #17915

ankye opened this issue Nov 25, 2024 · 4 comments
Labels
Feature Request Needs Triage Needs to be assigned by the team

Comments

@ankye
Copy link
Contributor

ankye commented Nov 25, 2024

Use Case

image
如上图json用zip压缩后再进行base64编码,生成新json,文件可以减少150k左右

Problem Description

包体减少建议

Proposed Solution

No response

How it works

No response

Alternatives Considered

newjson=base64(zip(jsontext))

优点:
1.大文件压缩明显
2.减少加载和gzip及下载时间

缺点:
1.小文件base64可能反而会增大
2.增加base64decode 和 unzip的时间

对比服务器gzip,因为是离线zip,减少了实时下载的时候gzip的时间,增加了decodebase64和unzip的时间
对比微信: 可以减少首包内json的大小

没有条件测试,只是提供个建议

Additional Information

No response

@ankye ankye added Feature Request Needs Triage Needs to be assigned by the team labels Nov 25, 2024
@ankye
Copy link
Contributor Author

ankye commented Nov 26, 2024

主要是想减少启动引擎自带json,场景prefab生成合并后的大json,文件太大

@ankye
Copy link
Contributor Author

ankye commented Nov 26, 2024

就是引擎自带打包出来的json文件,里面包含一些引擎配置,材质effect之类的,就是第一张图那个文件

@ankye
Copy link
Contributor Author

ankye commented Nov 26, 2024

自己项目内能处理的方式很多,但是引擎内的肯定在启动包里面

@ankye
Copy link
Contributor Author

ankye commented Nov 27, 2024

在小程序(微信,其他的不清楚)里,还可以分离引擎以减小包体

老哥是引擎组的人吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Needs Triage Needs to be assigned by the team
Projects
None yet
Development

No branches or pull requests

1 participant