Earlier quoted context omitted.
You can see the true size of the Go pclntab in ELF binaries using "readelf -S" and in Mac binaries using "otool -l". Its not zero. One thing that did change from Go 1.15 to Go 1.16 is that we broke up the pclntab into a few different pieces. Again, it's all in the section headers. But the pieces are not in the actual binary's symbol table anymore, because they don't need to be. And since the format is different, we w…
> OK, the pclntab is large. Why is it large? What are the specific things in it that are large? Is it reasonably easy to attribute individual entries in pclntab to specific symbols? If so I'd love to add this capability to https://github.com/google/bloaty which already tries to do per-symbol analysis of many other sections (eh_frame, rela.dyn, etc).
My Go executable files are still getting larger
141–150 of 174 posts
Re: My Go executable files are still getting larger
#142Earlier quoted context omitted.
Go uses DWARF.
Not for unwinding or line programs.
Re: My Go executable files are still getting larger
#143> starting in Go 1.16, the pclntab is not present any more, and instead is re-computed from other data in the executable file. Does anyone have a source for this? As it still appears to be there - Go 1.15 https://i.imgur.com/3YlZGOk.png - Go 1.16 https://i.imgur.com/gGYsj32.png
(This is derived from Russ' discussion above.)
Re: My Go executable files are still getting larger
#144I always wonder if this is the flip side of the fast compilation? It would be nice to be able to decide on those trade-offs ourselves. I mostly write web servers in Go, which (as the article says) are executed rarely, so init time really doesn't matter to me. But I've been looking at writing some desktop apps in Go, and then init time will matter.
Re: My Go executable files are still getting larger
#145Last but by no means least there are in total 13MB of autogenerated functions of the colexec package, each of which is over 100KB long, which are autogenerated and share virtually all of their code. These are an obscene waste of code space and undoubtedly de-deuplicating this code would not just reduce code size but also speed up the program, due to icache trashing.
Re: My Go executable files are still getting larger
#146It's time for debug info like this to be sent to "onlinesymbolserver.com", encrypted with a hash of the binary. Then, whenever a debugger connects to a binary, it can simply download the symbols as required. And for the 99.9% who don't need debug info, it isn't needlessly shipped. Microsoft invented this in the 90's...
I don't think this information in Go is used for debugging alone. It's also used by mallocgc and other parts of the runtime. This is why you will see "gentraceback" in the profiles of busy Go servers. It's not because your program is printing a lot of stack traces, it's because stack walking is a core part of the GC, and because some logic in the runtime refers to the names of functions to branch around special cases…
Re: My Go executable files are still getting larger
#147Earlier quoted context omitted.
Here is a question: imagine you could double performance of cockroa hDB by making the executable 2000MB - every db admin would make that choice
This is effectively what is happening btw; the crdb binary went from 80MB to 200MB in the same time it took to make it twice as fast. The % growth in size is not a problem on its own; it's more the % size attributed to the program vs. the % size attributed to unclear purposes, that's a problem.
Re: My Go executable files are still getting larger
#148Earlier quoted context omitted.
This is effectively what is happening btw; the crdb binary went from 80MB to 200MB in the same time it took to make it twice as fast. The % growth in size is not a problem on its own; it's more the % size attributed to the program vs. the % size attributed to unclear purposes, that's a problem.
What's the use case where a 200MB binary size is a problem?
Re: My Go executable files are still getting larger
#149Earlier quoted context omitted.
In env without swap, the binary size should/might block relative amount of ram. Might it be possible to stream binaries or to detect junks which could be unloaded like an json parser which is only needed when reading json
Without swap, you mean without virtual memory or without a swap partition/file? Because even without a swap partition/file, the whole executable will not block physical memory, but will page in/out as needed. And whole sections of it will never be loaded at all.
Re: My Go executable files are still getting larger
#150Earlier quoted context omitted.
I don't think this information in Go is used for debugging alone. It's also used by mallocgc and other parts of the runtime. This is why you will see "gentraceback" in the profiles of busy Go servers. It's not because your program is printing a lot of stack traces, it's because stack walking is a core part of the GC, and because some logic in the runtime refers to the names of functions to branch around special cases…
I assume those bits of runtime could be modified to have other special markers on the functions they need to special case...