Skip to main content

A high performance persistent bloom filter

Project description

Hydra: The Python Bloom Filter.

Compile with Cython 0.13 or higher. That means trunk as of 2010/04/21.

You should get no warnings, errors or other crap when compiling this module. If you do - something has gone wrong.

Hydra is a high performance bloom filter. It’s basically a port of the Cassandra bloom filter with some fun Cython hackery.

1) It’s persistent using memory mapped io. On Linux, the mmap uses the MAP_POPULATE flag so the entire file is loaded into kernel space virtual memory. In other words - fast.

2) The hash function uses the MurmurHash2A algorithm. I’m using the original code base in raw C - so it’s blazing fast and has excellent key distribution and avalanche properties.

3) The filter exports a set-like interface. Use .add(..), .contains() or use the “in” operator.

  1. Correctness is built-in - with test cases.

5) Did I say it’s fast? It’s stupidly fast. 200,000 lookups per second on my 1.6Ghz netbook.

The filter supports periodic forced synchronization to disk using fdatasync(), or you can just let the deallocator flush everything to disk when your filter goes out of scope, or your process terminates.

Hydras are snakes with multiple heads. They’re also bad dudes with snake logos on their chest who regularly try to beat on Nick Fury. Now it’s a bloom filter.

Mostly, I couldn’t bear to make this yet another PySomeLibraryName library.

Running tests:

Install nose.

Go into the tests directory and do :

nosetests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Hydra-1.2.tar.gz (65.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Hydra-1.2-py2.7-macosx-10.10-intel.egg (104.8 kB view details)

Uploaded Egg

File details

Details for the file Hydra-1.2.tar.gz.

File metadata

  • Download URL: Hydra-1.2.tar.gz
  • Upload date:
  • Size: 65.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Hydra-1.2.tar.gz
Algorithm Hash digest
SHA256 df10b1dd6afc3d691a85fd4661aeca08fb33aeb6fb867857199057e741992e17
MD5 25d52b16d8d6143542a14c75817c53a2
BLAKE2b-256 f6125dfc02b982fefbe61db1bbbec1eec6869cc84279b8db23d16bbdeeefd4aa

See more details on using hashes here.

File details

Details for the file Hydra-1.2-py2.7-macosx-10.10-intel.egg.

File metadata

File hashes

Hashes for Hydra-1.2-py2.7-macosx-10.10-intel.egg
Algorithm Hash digest
SHA256 0981f35d7745b5f248b829e4bf2721963017a6d8560192d3e5e11c43dd673a06
MD5 2a2b00c147269e5b57fa55307e2b0043
BLAKE2b-256 3c504f1c8413883a81b70661243b7619acafe71c03883c6c7a0c72f8c037e204

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page