Skip to main content

A high performance persistent bloom filter

Project description

[![Build Status](https://travis-ci.org/crankycoder/hydra.svg?branch=master)](https://travis-ci.org/crankycoder/hydra)

Hydra: The Python Bloom Filter.

Compile with Cython 0.24 or higher.

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 MurmurHash3 algorithm, so it should be fast and have excellent key distribution and avalanche properties.

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

  1. Tests. OMG what is wrong with people with no tests?

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.

Build, install a dev build and test:

$ pip install -r requirements.txt $ cythonize src/_hydra.pyx $ python setup.py develop $ python setup.py test

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-2.4.tar.gz (80.7 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for Hydra-2.4.tar.gz
Algorithm Hash digest
SHA256 ca19404410fe61a20d25d30a5c37795b6b1aad7930b5bee5eabe9c151355e0f5
MD5 22cd968b99f227e7fd6113013fa671ee
BLAKE2b-256 5ad0d22aaa93934707d6fb25406a8cffc401b06f0f4b597df9a8a9e2c6380b92

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