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

Avoid using text/template as it disables DCE and increases binary size #1041

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

david-its
Copy link

See issue #1040.

text/template package is using some of reflect functions which lead to DCE (dead code elimination) disabling in Go. It significantly increases WASM binary. After removing text/template one gets ~16MB docs/web/app.wasm file instead of current 22MB.

See issue maxence-charriere#1040.

text/template package is using some of reflect functions which lead to DCE (dead code elimination) disabling in Go.
It significantly increases WASM binary. After removing text/template one gets ~16MB docs/web/app.wasm file instead of current 22MB.
Copy link
Owner

@maxence-charriere maxence-charriere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank for this. Maybe it would be less risky to put a build directive here.

@david-its
Copy link
Author

Thank for this. Maybe it would be less risky to put a build directive here.

What do you mean? build tags?... I don't see much reasons for this, honestly. You fully control these templates. Why bother?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants