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

net/http/pprof: imports html/template which causes larger binaries #41569

Closed
egonelbre opened this issue Sep 23, 2020 · 3 comments
Closed

net/http/pprof: imports html/template which causes larger binaries #41569

egonelbre opened this issue Sep 23, 2020 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@egonelbre
Copy link
Contributor

egonelbre commented Sep 23, 2020

"html/template"
is using html/template which causes the compiler go into conservative mode. html/template internally uses text/template, which in turn contains a call to MethodByName.

It seems that the pprof usage of html/template is trivial and could be replaced by basic string printing. Of course this means it won't be taking advantage of html/template security model.

Does this sound reasonable? I can make a PR, if it does.

@egonelbre egonelbre changed the title net/http/pprof: imports html/template which causes larger binary size net/http/pprof: imports html/template which causes larger binaries Sep 23, 2020
@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 23, 2020
@cagedmantis cagedmantis added this to the Backlog milestone Sep 23, 2020
@cagedmantis
Copy link
Contributor

/cc @rsc

@rsc
Copy link
Contributor

rsc commented Sep 23, 2020

Sure, go ahead.

@gopherbot
Copy link

Change https://golang.org/cl/256900 mentions this issue: net/http/pprof: remove html/template dependency

@golang golang locked and limited conversation to collaborators Oct 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants