On Fri, Oct 11, 2019 at 01:23:12PM +0200, Richard Biener wrote: > > (coreutils-0.22) > > .debug_info(D1) | .debug_abbrev(D2) | .debug_str(D4) | .ctf > > (uncompressed) | ratio (.ctf/(D1+D2+0.5*D4)) > > ls 30616 | 1136 | 21098 | 26240 > > | 0.62 > > pwd 10734 | 788 | 10433 | 13929 > > | 0.83 > > groups 10706 | 811 | 10249 | 13378 > > | 0.80 > > > > (emacs-26.3) > > .debug_info(D1) | .debug_abbrev(D2) | .debug_str(D4) | .ctf > > (uncompressed) | ratio (.ctf/(D1+D2+0.5*D4)) > > emacs-26.3.1 674657 | 6402 | 273963 | 273910 > > | 0.33 > > > > I chose to account for 50% of .debug_str because at this point, it will be > > unfair to not account for them. Actually, one could even argue that upto 70% > > of the .debug_str are names of entities. CTF section sizes do include the > > CTF > > string tables. > > > > Across coreutils, I see a geomean of 0.73 (ratio of > > .ctf/(.debug_info + .debug_abbrev + 50% of .debug_str)). So, with the > > "-gdwarf-like-ctf code stubs" and dwz, DWARF continues to have a larger > > footprint than CTF (with 50% of .debug_str accounted for). > > I'm not convinced this "improvement" in size is worth maintainig another > debug-info format much less since it lacks desirable features right now > and thus evaluation is tricky. > > At least you can improve dwarf size considerably with a low amount of work. > > I suspect another factor where dwarf is bigger compared to CTF is that dwarf > is recording typedef names as well as qualified type variants. But maybe > CTF just has a more compact representation for the bits it actually > implements.
Does CTF record automatic variables in functions, or just global variables? If only the latter, it would be fair to also disable addition of local variable DIEs, lexical blocks. Does CTF record inline functions? Again, if not, it would be fair to not emit that either in .debug_info. -gno-record-gcc-switches so that the compiler command line is not encoded in the debug info (unless it is in CTF). DWARF is highly extensible format, what exactly is and is not emitted is something that consumers can choose. Yes, DWARF can be large, but mainly because it provides a lot of information, the actual representation has been designed with size concerns in mind and newer versions of the standard keep improving that too. Jakub