From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95809 invoked by alias); 28 Nov 2017 10:35:18 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 95799 invoked by uid 89); 28 Nov 2017 10:35:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=2.40, sk:malloc_, sum X-HELO: hqemgate16.nvidia.com Received: from hqemgate16.nvidia.com (HELO hqemgate16.nvidia.com) (216.228.121.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Nov 2017 10:35:12 +0000 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com id ; Tue, 28 Nov 2017 02:35:13 -0800 Received: from HQMAIL101.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 28 Nov 2017 02:35:10 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 28 Nov 2017 02:35:10 -0800 Received: from UKMAIL102.nvidia.com (10.26.138.15) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 28 Nov 2017 10:35:10 +0000 Received: from localhost.localdomain (10.21.38.99) by UKMAIL102.nvidia.com (10.26.138.15) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 28 Nov 2017 10:35:06 +0000 Subject: Re: Note on choosing string hash functions To: Pedro Alves References: <33c45098-17a4-4c8a-fb14-137e70c7bb3f@nvidia.com> <4fc8cd33-a362-ddf5-9a7c-e69eab385587@redhat.com> From: Dmitry Antipov CC: Message-ID: Date: Tue, 28 Nov 2017 10:35:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: UKMAIL102.nvidia.com (10.26.138.15) To UKMAIL102.nvidia.com (10.26.138.15) X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00028.txt.bz2 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