Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Joel Brobecker <brobecker@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [patch 2/2] iFort compat.: case insensitive symbols (PR 11313)
Date: Wed, 24 Nov 2010 18:53:00 -0000	[thread overview]
Message-ID: <m31v6azh8z.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20101122194336.GA21855@host0.dyn.jankratochvil.net> (Jan	Kratochvil's message of "Mon, 22 Nov 2010 20:43:36 +0100")

>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> There is more an issue MINIMAL_SYMBOL_HASH_SIZE is constant:
Jan> 	#define MINIMAL_SYMBOL_HASH_SIZE 2039
Jan> Some objfiles have many symbols:
Jan> 	libwebkit.so.debug: 54980 symbols
Jan> 		/MINIMAL_SYMBOL_HASH_SIZE = 27
Jan> 		log2(54980)=16

I looked at this a long time ago, when I was trying to reduce memory use.

My recollection is that our hashing here is pretty bad.  I seem to
remember a case where we had some empty hash buckets and some buckets
with 20 symbols.

Jan> In such case in fact the whole hash table makes no sense and it is even
Jan> cheaper to just do binary search on objfile->msymbols which is already
Jan> qsort-ed and be done with it.

msymbols is sorted by address first.

Note that changing this area is trickier than it seems due to the
mst_solib_trampoline handling in lookup_minimal_symbol (maybe obvious,
but it took me a while to realize it...).

Jan> Still a hash table should be faster than a binary search but the
Jan> hash table size would need to be adaptable.

I implemented this :-).  It slowed down startup, so it didn't go in.
See the archives around 2008-08-27.  Given your other comments this hit
may not be relevant.  I still have the patch if you are interested.

Jan> But rather than optimizations of this which reduce just the CPU
Jan> load which was in my measurements 2% during GDB startup (due to its
Jan> waiting on disk).  We could for example rather delay
Jan> searching+loading any objfiles' symbols we do not need which would
Jan> do another major GDB startup time reduction like .gdb_index did.

Yeah, this would be interesting to see.  I think find_main_filename may
make this difficult, but maybe it would work ok for the attach case.

This sort of reading could maybe be done in a background thread.

Also, I wonder why we read minsyms from separate debuginfo files.
Is that ever needed?

Tom


  parent reply	other threads:[~2010-11-24 18:53 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-07  3:50 Jan Kratochvil
2010-11-08 16:36 ` Joel Brobecker
2010-11-08 17:02   ` Jan Kratochvil
2010-11-08 18:31     ` Joel Brobecker
2010-11-22  3:54       ` Jan Kratochvil
2010-11-22 18:54         ` Joel Brobecker
2010-11-22 19:19           ` Jan Kratochvil
2010-11-22 19:30             ` Joel Brobecker
2010-11-22 19:44               ` Jan Kratochvil
2010-11-22 19:57                 ` Joel Brobecker
2010-11-24 18:53                 ` Tom Tromey [this message]
2010-11-24 19:22                   ` Jan Kratochvil
2010-11-24 20:01                     ` Tom Tromey
2010-11-24 20:08                       ` Joel Brobecker
2010-11-24 21:37                         ` Tom Tromey
2010-11-24 21:45                           ` Jan Kratochvil
2010-11-24 21:55                             ` Tom Tromey
2010-11-24 20:17                       ` Jan Kratochvil
2010-11-24 20:31                         ` Joel Brobecker
2010-11-24 20:58                           ` Jan Kratochvil
2011-04-08 17:59         ` obsolete: " Jan Kratochvil
2010-11-08 17:18   ` Pierre Muller
2010-11-07  3:50 [patch 1/2] Code cleanup: New init_one_comp_unit Jan Kratochvil
2010-11-12 18:36 ` Tom Tromey
2010-11-12 18:43   ` Jan Kratochvil
2010-11-12 18:46     ` Tom Tromey
2010-11-16  4:37       ` Jan Kratochvil

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=m31v6azh8z.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /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