-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
net/ghttp: 接口或 enums 越多,构建的二进制文件内容大小激增 #3863
Comments
生成 enums 时注意不要扫描全部代码只扫描定义 enums 的文件,不然就生成一堆无用的。 |
When generating enums, be careful not to scan the entire code and only scan the files that define enums, otherwise a bunch of useless code will be generated. The problem of many interfaces: Do not configure openApiPath in the production environment. Naturally, swagger documents will not be generated because there are many interfaces and the texts of swagger openapi are not small. |
@shuqingzai @ninjashixuan 可以使用 |
@shuqingzai @ninjashixuan You can use the |
Go version
go version go1.21.13 darwin/amd64
GoFrame version
2.7.3
Can this bug be reproduced with the latest release?
Option Yes
What did you do?
当项目接口越多或 enums 越多时,编译文件会变得非常大,我不清楚是 ghttp 还是 enums 的问题,当接口只有少量时,不明显,但是对比使用其它 http 组件也大得很
What did you see happen?
线上项目
使用 Zxilly/go-size-analyzer 分析,
rodata
有 40多 M最后完成了一个比较大的需求(多了 接口 和 enums),二进制文件居然达到 700MB ,这离得破 G 不远了
__rodata __TEXT
有 400多 MWhat did you expect to see?
编译文件的容量十分夸张
The text was updated successfully, but these errors were encountered: