Re: Hash Algorithm [was: Re: [PHP-DEV] Namespaces in PHP 6 - ++$take]
| From: | Marcus Boerger | Date: | Fri, 10 Nov 2006 23:24:00 +0000 |
| Subject: | Re: Hash Algorithm [was: Re: [PHP-DEV] Namespaces in PHP 6 - ++$take] | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-26499@lists.php.net to get a copy of this message | ||
Hello Sebastian,
the best ones unfortunatley are GPL and thus not acceptable. I once
played with case insensitive hashes. They worked very much faster -
but they had more conflicts. If we were about intel processors my
experience is that string functions can be optimized at assembler level
very much. For instance i once ago increased string up/downcase by 32
times using a table based xlat approach that was reading the string in
chunks of 4 byte. Maybe itcould be interesting to see whether we could
come up with a version that takes 4 byte or 8 byte chunks depending on
the cpu. And eventually we have hash codes in 64 bit machines be 8 bytes
long as well.
best regards
marcus
Friday, November 10, 2006, 7:20:59 PM, you wrote:
> Ilia Alshanetsky wrote:
>> As your key size increases the slower the key hash generation process
>> becomes, if you look at the PHP's hash key generation code you'll see
>> that it works best for 8 or less chars, anything longer and the
>> performance starts to drop.
> It's been a long time since I studied hashes: are there no hashing
> algorithms that perform better with more than 8 characters?
> --
> Sebastian Bergmann
> http://sebastian-bergmann.de/
> GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69
Best regards,
Marcus