-
Notifications
You must be signed in to change notification settings - Fork 209
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
String interning #3927
Comments
While we can certainly work towards improving the usage of strings, I don't see it being the highest contender for further improvements in Parca itself right now: https://pprof.me/a2522ef |
There are some discussions on adding a package to stdlib golang/go#62483 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you already considered string interning to reduce memory consumption?
I am aware of several approaches:
map[string]string
cons: it could grow forever[]byte
slices, see Is it possible to reduce allocations when interning a byte slice? go4org/intern#18It looks like Thanos got good results with
go4org/intern
thanos-io/thanos#5926, though I am not sure if it's ok to intern like thatintern.GetByString(s).Get().(string)
go4org/intern#19.See also Optimizing string usage in Go programs slides.
The text was updated successfully, but these errors were encountered: