Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Dmitry Antipov <dantipov@nvidia.com>
To: Pedro Alves <palves@redhat.com>
Cc: <gdb@sourceware.org>
Subject: Re: Note on choosing string hash functions
Date: Tue, 28 Nov 2017 10:35:00 -0000	[thread overview]
Message-ID: <ecac3e58-4bb0-e874-214e-6806ce4b0066@nvidia.com> (raw)
In-Reply-To: <f85c22af-a467-e4b9-611f-8c50ed10a9f6@redhat.com>

On 11/22/2017 05:10 AM, Pedro Alves wrote:

> I observe between 3% / 10% time drop.
> 
> (I used Joel's version of --readnever from here:
>   https://sourceware.org/ml/gdb-patches/2016-07/msg00103.html)
> 
> So in sum, I'm pretty convinced the patch is safe as is.

BTW, shouldn't we use safe-ctype.h macros through gdb/utils.c as well?
With this, there is a substantial difference between:

      9.83%  gdb      gdb                       [.] find_pc_sect_psymtab
      6.54%  gdb      gdb                       [.] bcache_full
      5.38%  gdb      libc-2.25.so              [.] tolower                             ; hmm...
      4.48%  gdb      gdb                       [.] htab_find_slot_with_hash
      4.39%  gdb      gdb                       [.] htab_hash_string
      3.88%  gdb      gdb                       [.] load_partial_dies
      3.61%  gdb      gdb                       [.] strcmp_iw_ordered
      3.45%  gdb      gdb                       [.] read_indirect_string_at_offset_from
      3.18%  gdb      gdb                       [.] cpname_parse
      3.07%  gdb      gdb                       [.] lookup_minimal_symbol_by_pc_name
      2.70%  gdb      gdb                       [.] read_attribute_value
      2.68%  gdb      libc-2.25.so              [.] __strcmp_sse2_unaligned
      2.47%  gdb      gdb                       [.] cpname_lex
      2.44%  gdb      gdb                       [.] peek_die_abbrev
      2.32%  gdb      libc-2.25.so              [.] _int_malloc
      2.15%  gdb      gdb                       [.] d_print_comp_inner
      1.80%  gdb      libc-2.25.so              [.] isspace                             ; hmm...
      1.47%  gdb      gdb                       [.] cp_canonicalize_string[abi:cxx11]
      1.45%  gdb      gdb                       [.] eq_demangled_name_entry
      1.39%  gdb      libc-2.25.so              [.] malloc_consolidate.part.1

and:

     10.97%  gdb      gdb                       [.] find_pc_sect_psymtab
      7.25%  gdb      gdb                       [.] bcache_full
      4.82%  gdb      gdb                       [.] htab_hash_string
      4.65%  gdb      gdb                       [.] htab_find_slot_with_hash
      4.28%  gdb      gdb                       [.] load_partial_dies
      3.69%  gdb      gdb                       [.] read_indirect_string_at_offset_from
      3.45%  gdb      gdb                       [.] cpname_parse
      3.37%  gdb      gdb                       [.] lookup_minimal_symbol_by_pc_name
      3.03%  gdb      gdb                       [.] read_attribute_value
      3.01%  gdb      gdb                       [.] strcmp_iw_ordered
      2.99%  gdb      libc-2.25.so              [.] __strcmp_sse2_unaligned
      2.81%  gdb      gdb                       [.] peek_die_abbrev
      2.74%  gdb      gdb                       [.] cpname_lex
      2.57%  gdb      libc-2.25.so              [.] _int_malloc
      2.40%  gdb      gdb                       [.] d_print_comp_inner
      1.59%  gdb      gdb                       [.] eq_demangled_name_entry
      1.56%  gdb      libc-2.25.so              [.] malloc_consolidate.part.1
      1.56%  gdb      gdb                       [.] cp_canonicalize_string[abi:cxx11]
      1.00%  gdb      libc-2.25.so              [.] strlen

IIUC this is because strcmp_iw_ordered() is quite critical when building partial symbol tables.

Dmitry


  parent reply	other threads:[~2017-11-28 10:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-17  9:50 Dmitry Antipov
2017-11-17 13:42 ` Pedro Alves
2017-11-22  2:10   ` Pedro Alves
2017-11-22  2:25     ` Pedro Alves
2017-11-28 10:35     ` Dmitry Antipov [this message]
2017-11-28 12:00       ` Pedro Alves
2017-11-28 15:13         ` Dmitry Antipov
2017-11-28 15:23           ` Pedro Alves

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=ecac3e58-4bb0-e874-214e-6806ce4b0066@nvidia.com \
    --to=dantipov@nvidia.com \
    --cc=gdb@sourceware.org \
    --cc=palves@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