NYCPHP Meetup

NYPHP.org

[nycphp-talk] new hash filter system..

Adam Maccabee Trachtenberg adam at trachtenberg.com
Tue Apr 27 13:05:23 EDT 2004


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

> On Tue, 2004-04-27 at 11:51, Adam Maccabee Trachtenberg wrote:
> > 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.
>
> Bloom filters use a long binary string, an integer could not be used
> with a bloom filter method.

Why don't you use GMP?

http://www.php/net/gmp

It requires an external library, but it'll be much faster than an
all-PHP solution for very large numbers.

There's also the BC math library, which is bundled with PHP, but you
need to emulate bitwise operations in userland code, which doesn't
seem too efficient.

-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