-
Notifications
You must be signed in to change notification settings - Fork 18k
x/text: usage of text/template or html/template disables compiler DCE #72787
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
Comments
Where specifically? can you show a reproducer? |
Related Issues (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
This comment has been minimized.
This comment has been minimized.
I don't think there is anything we can do here. |
Most of x/text's use of template seems to be for codegen |
@seankhliao are these even a problem, given that happens before compile time? |
That's why I was asking for more information on this issue? |
This comment has been minimized.
This comment has been minimized.
the use of html/template in x/net/trace is unfortunate but necessary for its safe operation (rendering html pages). that is not the same as the use of template in x/text |
The importable packages in x/text do not cause disabling DCE, only the installable tools do:
This does not look like a problem. |
Go version
go 1.24
Output of
go env
in your module/workspace:What did you do?
x/text
package usestext/template
package which disables DCE (dead code elimination) in compiler due to usage of specific reflect methods. This typically executable binary size by 25-30%.What did you see happen?
Increases executable size
What did you expect to see?
Smaller executable
The text was updated successfully, but these errors were encountered: