From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, Jakub Jelinek <jakub@redhat.com>,
Mark Wielaard <mark@klomp.org>
Cc: Michael Matz <matz@suse.de>
Subject: Re: [RFC] Implement C++ One Definition Rule for struct, class and union
Date: Tue, 01 Jan 2019 00:00:00 -0000 [thread overview]
Message-ID: <199ef515-41a1-0323-9e92-359e04b850a7@suse.de> (raw)
In-Reply-To: <8fdf524a-8cdb-8f9e-3b02-104a07f3f072@suse.de>
On 12-11-2019 14:56, Tom de Vries wrote:
> V. Effect
>
> We use a cc1 executable to generate executables compressed with no odr,
> --odr and --odr-unify:
> ...
> $ dwz -l50000000 cc1 -o 1
> $ dwz -l50000000 cc1 -o 2 --odr
> $ dwz -l50000000 cc1 -o 3 --odr-unify
> ...
>
> Then we can inspect the differences:
> ...
> $ diff.sh cc1 1
> .debug_info red: 44.80% 111527248 61570632
> .debug_abbrev red: 40.16% 1722726 1030935
> .debug_str red: 0% 6609355 6609355
> total red: 42.26% 119859329 69210922
> $ diff.sh cc1 2
> .debug_info red: 55.16% 111527248 50019425
> .debug_abbrev red: 68.13% 1722726 549035
> .debug_str red: 0% 6609355 6609355
> total red: 52.30% 119859329 57177815
> $ diff.sh cc1 3
> .debug_info red: 58.18% 111527248 46649959
> .debug_abbrev red: 79.57% 1722726 352080
> .debug_str red: 0% 6609355 6609355
> total red: 55.28% 119859329 53611394
> ...
>
> So, the .debug_info and .debug_abbrev sections are reduced in size by:
> - by 42% when not using odr,
> - by 52% when using --odr, and
> - by 55% when using --odr-unify.
>
> VI. Cost
>
> Using the same cc1 example as in V, we can see the cost of the optimization:
At V, I correctly used -l50000000 (l lower-case), but here I accidentally
used -L50000000 (L upper-case). Which means low-mem mode kicked in and
disabled the optimization midway, so the time and mem results presented here
earlier were off.
Let's try again:
...
$ time.sh dwz -l50000000 cc1 -o 1
maxmem: 1341888
real: 7.09
user: 6.90
system: 0.18
$ time.sh dwz -l50000000 cc1 -o 2 --odr
maxmem: 1336612
real: 18.72
user: 18.54
system: 0.17
$ time.sh dwz -l50000000 cc1 -o 3 --odr-unify
maxmem: 1336216
real: 13.76
user: 13.57
system: 0.18
...
> It's good to note though that without the patch series applied, we use less
> memory, due to the struct dw_die not having the copy/origin fields:
And here again:
...
$ time.sh dwz -lnone cc1 -o 1
maxmem: 1179928
real: 6.98
user: 6.83
system: 0.14
...
Thanks,
- Tom
prev parent reply other threads:[~2019-11-13 22:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-01 0:00 Tom de Vries
2019-01-01 0:00 ` Michael Matz
2019-01-01 0:00 ` Tom de Vries [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199ef515-41a1-0323-9e92-359e04b850a7@suse.de \
--to=tdevries@suse.de \
--cc=dwz@sourceware.org \
--cc=jakub@redhat.com \
--cc=mark@klomp.org \
--cc=matz@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).