2003-08-21 Michael Chastain <mec@shout.net>
authorMichael Chastain <mec@google.com>
Thu, 21 Aug 2003 19:55:32 +0000 (19:55 +0000)
committerMichael Chastain <mec@google.com>
Thu, 21 Aug 2003 19:55:32 +0000 (19:55 +0000)
* symtab.h: Add doco on the space critical structures and
some measurements of space usage.

gdb/ChangeLog
gdb/symtab.h

index 2d82dc9e7205c392c673375f575db111a6866a22..28007db694fb739079485395560a394553ce08bc 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-21  Michael Chastain  <mec@shout.net>
+
+       * symtab.h: Add doco on the space critical structures and
+       some measurements of space usage.
+
 2003-08-21  Michael Snyder  <msnyder@redhat.com>
 
        * tracepoint.c (trace_dump_command): Trace break address
index a7f1e30ecd346455f5569240bae5c4d0f5b6f862..da301254749e54bd328fca28edca88bd0b7b06fb 100644 (file)
@@ -35,13 +35,55 @@ struct blockvector;
 struct axs_value;
 struct agent_expr;
 
+/* Some of the structures in this file are space critical.
+   The space-critical structures are:
+
+     struct general_symbol_info
+     struct symbol
+     struct partial_symbol
+
+   These structures are layed out to encourage good packing.
+   They use ENUM_BITFIELD and short int fields, and they order the
+   structure members so that fields less than a word are next
+   to each other so they can be packed together. */
+
+/* Rearranged: used ENUM_BITFIELD and rearranged field order in
+   all the space critical structures (plus struct minimal_symbol).
+   Memory usage dropped from 99360768 bytes to 90001408 bytes.
+   I measured this with before-and-after tests of
+   "HEAD-old-gdb -readnow HEAD-old-gdb" and
+   "HEAD-new-gdb -readnow HEAD-old-gdb" on native i686-pc-linux-gnu,
+   red hat linux 8, with LD_LIBRARY_PATH=/usr/lib/debug,
+   typing "maint space 1" at the first command prompt.
+
+   Here is another measurement (from andrew c):
+     # no /usr/lib/debug, just plain glibc, like a normal user
+     gdb HEAD-old-gdb
+     (gdb) break internal_error
+     (gdb) run
+     (gdb) maint internal-error
+     (gdb) backtrace
+     (gdb) maint space 1
+
+   gdb gdb_6_0_branch  2003-08-19  space used: 8896512
+   gdb HEAD            2003-08-19  space used: 8904704
+   gdb HEAD            2003-08-21  space used: 8396800 (+symtab.h)
+   gdb HEAD            2003-08-21  space used: 8265728 (+gdbtypes.h)
+
+   The third line shows the savings from the optimizations in symtab.h.
+   The fourth line shows the savings from the optimizations in
+   gdbtypes.h.  Both optimizations are in gdb HEAD now.
+
+   --chastain 2003-08-21  */
+
+
+
 /* Define a structure for the information that is common to all symbol types,
    including minimal symbols, partial symbols, and full symbols.  In a
    multilanguage environment, some language specific information may need to
-   be recorded along with each symbol.
+   be recorded along with each symbol. */
 
-   These fields are ordered to encourage good packing, since we frequently
-   have tens or hundreds of thousands of these.  */
+/* This structure is space critical.  See space comments at the top. */
 
 struct general_symbol_info
 {
@@ -557,6 +599,8 @@ struct alias_list
   struct alias_list *next;
 };
 
+/* This structure is space critical.  See space comments at the top. */
+
 struct symbol
 {
 
@@ -638,6 +682,8 @@ struct symbol
    on a  partial symtab list and which points to the corresponding 
    normal symtab once the partial_symtab has been referenced.  */
 
+/* This structure is space critical.  See space comments at the top. */
+
 struct partial_symbol
 {
 
This page took 0.034144 seconds and 4 git commands to generate.