NYCPHP Meetup

NYPHP.org

[nycphp-talk] new hash filter system..

Adam Maccabee Trachtenberg adam at trachtenberg.com
Tue Apr 27 11:51:40 EDT 2004


On Tue, 27 Apr 2004, Joel De Gan wrote:

> I did some research with bloom filters and worked up a sort-of-similar,
> but non-binary, system in PHP.
> See http://peoplesdns.com/filter/ for explaination and code.

This looks really interesting.

> Basically, anyone know of any reasons this might break? That it might be
> an issue under certain circumstances, ways to make it better, problems
> with the incremental approach etc.. I would especially be interested in
> mathematical references that link to similar items that I may have
> overlooked.

At first glance, your approach seems to use a lot more memory than the
original. The first version stores everything in a single integer (or
double), but you're using a giant array of strings.

Also, bitwise checks should be much faster than all the string/array
exploding and imploding your method requires.

Have you benchmarked your code against the original algorithm to see
which is faster?

However, like I said, I only skimmed over the code, so I could be
completely off base, so take everything I say with a grain of salt.

-adam

-- 
adam at trachtenberg.com
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!



More information about the talk mailing list