Hi Julien,

Could you be more specific. From the first look MurmurHash2is more
expensive, but may be it reduces number of collisions.
what implementation(s) did you use (src or patch)? how did you measure the
speed? did you try to embed it into PHP?

Thanks. Dmitry.

On Tue, Jun 16, 2015 at 10:24 AM, Julien Pauli <jpa...@php.net> wrote:

> Just to throw back another discussion based on this topic, has anyone
> considered changing the hash algorithm about string keys (real hashes) ?
>
> I gave MurmurHash2 a try, it was twice faster than DJB33 in my benchs
> (64bits platform and 64bits MurmurHash2 variant).
> 128bits MurmurHash3 however was a little bit slower than DJB33.
> I did not analyze collision risks though, but a valgrind/calgrind bench on
> many scenarios showed a better response time and a better zend_hash_func()
> response time with MurmurHash2.
>
>
> Julien.P
>
>
>
> On Tue, Jun 16, 2015 at 3:28 AM, Yasuo Ohgaki <yohg...@ohgaki.net> wrote:
>
>> Hi Dmitry,
>>
>> On Mon, Jun 15, 2015 at 6:06 PM, Dmitry Stogov <dmi...@zend.com> wrote:
>>
>> > I see only the test for "packed" array. You may create similar "hash"
>> > array, initializing it in reverse order.
>> >
>>
>> It's better approach to see the difference because the array content is
>> basically the same.
>>
>>
>> >
>> > In my experiments "packed" arrays are slightly (8%) faster.
>> >
>> > $ sapi/cli/php packed.php
>> > Time: 0.022471189498901
>> > Time: 0.012310028076172
>> >
>> > $ sapi/cli/php hash.php
>> > Time: 0.024425029754639
>> > Time: 0.012874126434326
>>
>>
>> It's faster on my PC, too.
>> 8% is good enough to have.
>> I'm surprised that PHP's hash is super fast :)
>>
>> Regards,
>>
>> --
>> Yasuo Ohgaki
>> yohg...@ohgaki.net
>>
>
>

Reply via email to