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

cmd/compile: large constant strings do not get reused #13145

Closed
mpvl opened this issue Nov 4, 2015 · 2 comments
Closed

cmd/compile: large constant strings do not get reused #13145

mpvl opened this issue Nov 4, 2015 · 2 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@mpvl
Copy link
Contributor

mpvl commented Nov 4, 2015

In x/text/language/tables.go, if I replace the string const types with var, I get a significant reduction in binary size for:

package main
import (
    "fmt"
    "golang.org/x/text/language"
)
func main() {
    fmt.Print(language.Version)
}
@mpvl mpvl assigned rsc Nov 4, 2015
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Nov 5, 2015
mpvl added a commit to golang/text that referenced this issue Nov 5, 2015
This generates much smaller code. See golang.org/issue/13145.

Update golang/go#13145

Change-Id: Iad06f6bd3a59cb8257bb8f9e331b7e6dc1d28efa
Reviewed-on: https://go-review.googlesource.com/16625
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
@josharian
Copy link
Contributor

@mpvl a fix went into 1.7 that should have helped with this. Can you confirm/disconfirm?

@bradfitz bradfitz added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 25, 2016
@mpvl
Copy link
Contributor Author

mpvl commented Aug 26, 2016

I can no longer reproduce it. It appears to be fixed! (In fact, the binary gets slightly smaller now switching to string consts.)

Thanks!

@golang golang locked and limited conversation to collaborators Aug 26, 2017
@rsc rsc removed their assignment Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants