This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: htab_hash_string
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>, Richard Henderson <rth at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Subject: Re: htab_hash_string
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Fri, 17 Aug 2001 09:54:48 -0700
--On Friday, August 17, 2001 07:10:30 AM +0100 Neil Booth
<neil@daikokuya.demon.co.uk> wrote:
> Richard Henderson wrote:-
>
>> A new function for libiberty that I plan on using shortly.
>>
>>
>> r~
>
> I've also sometimes wondered if it's worth hashing up to the first,
> say 20, bytes only, to speed it up. That would make it more
> reasonable for hashing long string literals; something I intend to get
> us to start doing again. I don't believe there is much gain in
> assuming that more than the first 20 bytes of many character strings /
> identifiers are identical.
We are now entering the realm of much wild speculation; people have
worried about this a lot.
At least one compiler hashes the first few, last few, and middle few
characters of the string. The idea is that a lot of functions might
begin and end the same, but even then their middles are different.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com