Package ring provides a high performance and thread safe Go implementation of a bloom filter.
Branch: master
Clone or download

README.md

ring - high performance bloom filter

Build Status Coverage Status Go Report Card GoDoc GitHub license Mentioned in Awesome Go

Package ring provides a high performance and thread safe Go implementation of a bloom filter.

Usage

Please see the godoc for usage.

Accuracy

Running make will perform unit tests, comparing the target false positive rate with the actual rate. Here is a test against 1 million elements with a targeted false positive rate of 0.1%. Tests fail if the number of false positives exceeds the target.

=== RUN   TestBadParameters
--- PASS: TestBadParameters (0.00s)
=== RUN   TestReset
--- PASS: TestReset (0.30s)
=== RUN   TestData
--- PASS: TestData (17.27s)
PASS
>> Number of elements:  1000000
>> Target false positive rate:  0.001000
>> Number of false positives:  137
>> Actual false positive rate:  0.000137
>> Benchmark Add():   5000000          257 ns/op
>> Benchmark Test():  10000000         175 ns/op
ok      command-line-arguments  21.089s

License

Copyright (c) 2019 Tanner Ryan. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.