axiak/pybloomfiltermmap — pull request #15 by dlecocq (2011-12-04 17:11:17+00:00)
Title: Superfast

The md5 hash comes with an unnecessary performance penalty when compared with other hashes suitable for bloom filters. Superfast hash improves the speed tests by a factor of about 3.5:

# Using MD5
$ ./speedtest.py
took 0.13539 s/run
took 0.02319 s/run
$ ./accuracytest.py
Specified: 0.010000; Measured: 0.000487; num_hashes: 7, num_bits: 1889580
Specified: 0.001000; Measured: 0.000000; num_hashes: 10, num_bits: 2834370
Specified: 0.000100; Measured: 0.000000; num_hashes: 14, num_bits: 3779160

# Using superfast hash
$ ./speedtest.py
took 0.04177 s/run
took 0.00700 s/run
$ ./accuracytest.py
Specified: 0.010000; Measured: 0.000487; num_hashes: 7, num_bits: 1889580
Specified: 0.001000; Measured: 0.000000; num_hashes: 10, num_bits: 2834370
Specified: 0.000100; Measured: 0.000000; num_hashes: 14, num_bits: 3779160