Re:How the Go runtime implements maps efficiently without ge...
by jcelerier on Wednesday September 05, 2018 @08:43AM
(#17917370)
MSVC has /OPT:ICF which does this. GCC has -fipa-icf, and the GNU Gold linker has --icf={safe,all} options (since it's operating on ASM it needn't be at the compiler level).
In both cases it does not only work with templates, but with any kind of function. However if you use --icf=all, some subtle bugs can appear since function pointers that would compare different in a default build would now compare equal. I have never been bitten by those.
Re:How the Go runtime implements maps efficiently without ge...
by iainmerrick on Wednesday September 05, 2018 @10:40AM
(#17918367)
Cool! I’ll give those a try.
This stuff is being actively worked on so I don’t know if merging identical template instantiations is a thing yet. Any idea?