On Wednesday 2013-12-04 16:36 -0500, Ehsan Akhgari wrote:
> On Tue, Dec 3, 2013 at 2:47 PM, L. David Baron <dba...@dbaron.org> wrote:
> > I'd certainly hope that nearly all of the difference in size of
> > libxul.so is debugging info that wouldn't be present in a non-debug
> > build.  But it's worth testing, because if that's not the case,
> > there are some serious improvements that could be made in the C/C++
> > toolchain...
> 
> Well, not really.  In the case of unified builds, the compiler sees larger
> translation units, so it has better opportunity for optimizations such as
> inlining, DCE, etc.

I did a set of builds on changeset 8648aa476eef, on 64-bit Linux
with gcc, to test these theories.

             Neither -DDEBUG        -DDEBUG          optimized
              nor optimized

The sizes I get from the build (with -g) are:
Nonunified     834700176          905487728          907369496
Unified        520194760          563257880          554848888

If I run "strip --strip-debug" on these, this removes the vast
majority of the size difference:
Nonunified     155896907          176296907           87984550
Unified        152048885          168215761           87616359

And if I further run "strip" on these, I get:
Nonunified     111273928          128967104           65150320
Unified        109413312          123112424           64863456

readelf -WS (on the "optimized" pair) showed size differences in
many of the sections, but the largest differences were the .debug_*
ones.

So indeed, *most* of the size difference is debugging info.  But
there is indeed still a small size difference without the debugging
info (about 0.5% for optimized and not -DDEBUG, more without
optimization or with -DDEBUG).

(I still have all of the above binaries if people are interested in
more information from them.)

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Attachment: signature.asc
Description: Digital signature

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to