This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
comdat types data for firefix [was Re: [10/15] Basic value access routines]
- From: Doug Evans <dje at google dot com>
- To: Tom Tromey <tromey at redhat dot com>, Ulrich Weigand <uweigand at de dot ibm dot com>, gdb at sourceware dot org
- Cc: Cary Coutant <ccoutant at google dot com>
- Date: Wed, 12 Aug 2009 16:15:55 -0700
- Subject: comdat types data for firefix [was Re: [10/15] Basic value access routines]
[moved to gdb@ from gdb-patches@]
On Wed, Jun 24, 2009 at 9:25 AM, Doug Evans<dje@google.com> wrote:
> On Wed, Jun 24, 2009 at 8:46 AM, Daniel Jacobowitz<drow@false.org> wrote:
>> On Wed, Jun 24, 2009 at 09:31:16AM -0600, Tom Tromey wrote:
>>> A related idea that occurred to me is that, with Jan's type GC, we
>>> could detach types from objfiles and "intern" them (something like
>>> bcache-for-types). ?This would only be a win if there are many
>>> identical types distributed across objfiles, though.
>>
>> There's plenty of identical types within a single objfile. ?Load GDB
>> with -readnow, and I find 66 copies of the typedef for "FILE", for
>> instance.
>
> As a data point, I compiled gdb with -g -O2 and again with -gdwarf-4 -O2.
>
> -rwxr-x--- 1 dje eng 16321609 Jun 24 08:52 gdb
> -rwxr-x--- 1 dje eng 13019406 Jun 24 08:50 gdb-dw4
>
> Starting gdb with -readnow and then examining space usage:
>
> -g -O2:
> gdb$ ps l 24343
> F ? UID ? PID ?PPID PRI ?NI ? ?VSZ ? RSS WCHAN ?STAT TTY ? ? ? ?TIME COMMAND
> 0 67641 24343 24342 ?20 ? 0 117356 97764 - ? ? ?S+ ? pts/13 ? ? 0:00 ../../../..
>
> -gdwarf-4 -O2:
> gdb$ ps l 24349
> F ? UID ? PID ?PPID PRI ?NI ? ?VSZ ? RSS WCHAN ?STAT TTY ? ? ? ?TIME COMMAND
> 0 67641 24349 16588 ?20 ? 0 ?72088 53280 - ? ? ?S+ ? pts/13 ? ? 0:00 ../../../..
>
> Until my comdat types patch is vetted more, these numbers are to be
> taken with a grain of salt, but they are promising.
>
I collected some data for mozilla (Tom, I remember you asking about
it - you may have forgotten, but here it is :-)).
With a top of tree gdb, debug build of firefox-3.5rc3, compiled with
-g and with -gdwarf-4,
bash1$ [start firefox, leaving it at its "Choose User Profile" dialog box]
bash2$ ./gdb -readnow -nx objdir-ff-debug/dist/bin/firefox-bin
(gdb) attach <firefox-bin-pid>
bash3$ ps l <gdb-pid>
without dw4:
F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND
0 67641 2206 1906 20 0 1842364 1794596 - S+ pts/12 0:29 ./gdb -nx
with dw4:
F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND
0 67641 2355 1906 20 0 922644 873940 - S+ pts/12 0:20 ./gdb -nx
Umm, wow.
I can't discount the possibility that I messed up somewhere :-), but I
think this is pretty cool.