Hello,
I have looked into Zend/zend_hash.h and I guess it might be sped up a
little. So far it uses D. Bernstein's hash which is quite fast, but I
think it might be worth replacing it with MurmurHash. I have tried
comparison of speed for them (both as separate C programs, and
compiled into PHP 5_3). Results for REAL keys (collected on running
web server) are at the bottom of this page: http://212.85.117.53/gsoc/
index.php?option=com_content&view=article&id=65:hash-functions-for-
hash-tables&catid=34:profiling&Itemid=54
Murmur is Public Domain, and its author is maintaining it all the
time so I guess it will be faster and better. There is comparison of
distribution at both the page I gave and here: http://
murmurhash.googlepages.com/
The patch for 5_3 (applicable to HEAD) as attachment
Hello,
I have looked into Zend/zend_hash.h and I guess it might be sped up
a little. So far it uses D. Bernstein's hash which is quite fast,
but I think it might be worth replacing it with MurmurHash. I have
tried comparison of speed for them (both as separate C programs, and
compiled into PHP 5_3). Results for REAL keys (collected on running
web server) are at the bottom of this page: http://212.85.117.53/gsoc/index.php?option=com_content&view=article&id=65:hash-functions-for-hash-tables&catid=34:profiling&Itemid=54
speeding up array's does indeed look like a place where one could give
a nice boost to many php applications. however it is also a place that
could create such as many problems of course. so getting this into 5.3
seems a bit unlikely at this point given that the feature freeze is
planned for the 24th.
that being said, on the page i only see benchmarks with artificial
data/code. did you also run some benchmarks again some popular php
applications so see what the real world benefits are in terms of
requests per second?
regards,
Lukas Kahwe Smith
mls@pooteeweet.org
Hi Michal,
Can you please send a link to the patch so we can review? I didn't get
the attachment.
Thanks,
Andi
-----Original Message-----
From: Michal Dziemianko [mailto:michal.dziemianko@gmail.com]
Sent: Monday, July 21, 2008 8:29 AM
To: internals@lists.php.net
Subject: [PHP-DEV] zend_inline_hash_function reimplementationHello,
I have looked into Zend/zend_hash.h and I guess it might be sped up a
little.
So far it uses D. Bernstein's hash which is quite fast, but I think it
might
be worth replacing it with MurmurHash. I have tried comparison of
speed for
them (both as separate C programs, and compiled into PHP 5_3). Results
for
REAL keys (collected on running web server) are at the bottom of this
page:
http://212.85.117.53/gsoc/
index.php?option=com_content&view=article&id=65:hash-functions-for-
hash-tables&catid=34:profiling&Itemid=54Murmur is Public Domain, and its author is maintaining it all the time
so I
guess it will be faster and better. There is comparison of
distribution at
both the page I gave and here: http:// murmurhash.googlepages.com/The patch for 5_3 (applicable to HEAD) as attachment
Hi Andi,
The patch is attached for 5_3.
I've got some time allocated tomorrow to review all of Michal's patches
that have been produced for the GSoC. I'll try to post some figures from
real life apps.
Scott
Andi Gutmans wrote:
Hi Michal,
Can you please send a link to the patch so we can review? I didn't get
the attachment.Thanks,
Andi-----Original Message-----
From: Michal Dziemianko [mailto:michal.dziemianko@gmail.com]
Sent: Monday, July 21, 2008 8:29 AM
To: internals@lists.php.net
Subject: [PHP-DEV] zend_inline_hash_function reimplementationHello,
I have looked into Zend/zend_hash.h and I guess it might be sped up a
little.
So far it uses D. Bernstein's hash which is quite fast, but I think it
might
be worth replacing it with MurmurHash. I have tried comparison of
speed for
them (both as separate C programs, and compiled into PHP 5_3). Results
for
REAL keys (collected on running web server) are at the bottom of this
page:
http://212.85.117.53/gsoc/
index.php?option=com_content&view=article&id=65:hash-functions-for-
hash-tables&catid=34:profiling&Itemid=54Murmur is Public Domain, and its author is maintaining it all the time
so I
guess it will be faster and better. There is comparison of
distribution at
both the page I gave and here: http:// murmurhash.googlepages.com/The patch for 5_3 (applicable to HEAD) as attachment
Thanks. Is there also a 64bit variant of this algorithm? That could
deliver a substantial benefit.
Andi
-----Original Message-----
From: Scott MacVicar [mailto:scott@macvicar.net]
Sent: Monday, July 21, 2008 11:15 AM
To: Andi Gutmans
Cc: Michal Dziemianko; internals@lists.php.net
Subject: Re: [PHP-DEV] zend_inline_hash_function reimplementationHi Andi,
The patch is attached for 5_3.
I've got some time allocated tomorrow to review all of Michal's
patches that
have been produced for the GSoC. I'll try to post some figures from
real life
apps.Scott
Andi Gutmans wrote:Hi Michal,
Can you please send a link to the patch so we can review? I didn't
get
the attachment.Thanks,
Andi-----Original Message-----
From: Michal Dziemianko [mailto:michal.dziemianko@gmail.com]
Sent: Monday, July 21, 2008 8:29 AM
To: internals@lists.php.net
Subject: [PHP-DEV] zend_inline_hash_function reimplementationHello,
I have looked into Zend/zend_hash.h and I guess it might be sped up
a
little.
So far it uses D. Bernstein's hash which is quite fast, but I think
it
might
be worth replacing it with MurmurHash. I have tried comparison of
speed for
them (both as separate C programs, and compiled into PHP 5_3).
Results
for
REAL keys (collected on running web server) are at the bottom of
this
page:
http://212.85.117.53/gsoc/
index.php?option=com_content&view=article&id=65:hash-functions-for-
hash-tables&catid=34:profiling&Itemid=54Murmur is Public Domain, and its author is maintaining it all the
time
so I
guess it will be faster and better. There is comparison of
distribution at
both the page I gave and here: http:// murmurhash.googlepages.com/The patch for 5_3 (applicable to HEAD) as attachment
Hi!
I understand this patch has potential portability issues for
architectures that won't be able to read int's unaligned.
Maybe we could keep both of them and do some configure test to see if it
works fine, if not - use the old one?
Also I understand that this function returns uint while old hash
returned ulong. What happens with that on 64-bit platforms?
Stanislav Malyshev, Zend Software Architect
stas@zend.com http://www.zend.com/
(408)253-8829 MSN: stas@zend.com
There is an aligned version of the algorithm available but its slower,
there is also a 64-bit version in the works. I emailed the author
about its progress to check.
At the moment adding both looks the way forward, i'll benchmark a PPC
version of the algorithm shortly.
Scott
Hi!
I understand this patch has potential portability issues for
architectures that won't be able to read int's unaligned.Maybe we could keep both of them and do some configure test to see
if it works fine, if not - use the old one?Also I understand that this function returns uint while old hash
returned ulong. What happens with that on 64-bit platforms?Stanislav Malyshev, Zend Software Architect
stas@zend.com http://www.zend.com/
(408)253-8829 MSN: stas@zend.com