In CL 35554 for #18704, @josharian added some very nice allocation optimizations, as part of his efforts to claw back some of the allocation penalty of #8405, but a result was a modest increase in binary size.
In CL 35554, @josharian mentioned that the ~0.5% binary size increase could likely be recovered in the future, and there was some discussion of adding a tracking issue for that.
I did a quick look for that follow-up tracking issue a couple years ago, and again searched just now, but both times haven't found it.
Posting this new issue now in case it is helpful to either:
Here is a snippet from CL 35554:
This CL adds ~0.5% to binary size, despite
decreasing the size of many functions,
because it also adds many static symbols.This binary size regression could be recovered in
future (but currently unplanned) work.There is a lot of content-duplication in these
symbols; this statement generates six new symbols,
three containing an int 1 and three containing
a pointer to the string "a":fmt.Println(1, 1, 1, "a", "a", "a")
These symbols could be made content-addressable.
Furthermore, these symbols are small, so the
alignment and naming overhead is large.
As with the go.strings section, these symbols
could be hidden and have their alignment reduced.
Another reason for posting now is that there is some recent renewed energy around binary size (#6853).
Sorry if I missed something obvious. @josharian or anyone else, feel free to close if this is already addressed or tracked elsewhere.
I attempted content addressability and failed, and never picked it up again. https://go-review.googlesource.com/42170
I鈥檓 not sure whether the alignment and symbol visibility changes happened. I imagine so, but cc @cherrymui just in case.
Thanks @josharian for the quick comment. Also, I should have said this explicitly that of course this might not be worth doing, especially given finite time and opportunities for other improvements. 馃槄
Most helpful comment
I attempted content addressability and failed, and never picked it up again. https://go-review.googlesource.com/42170
I鈥檓 not sure whether the alignment and symbol visibility changes happened. I imagine so, but cc @cherrymui just in case.