Show HN: Go Package Implementing Age-Partitioned Bloom Filters (APBF)

0
0
Show HN: Go Package Implementing Age-Partitioned Bloom Filters (APBF)

Age-Partitioned Bloom Filters (APBF) is a authentic means for duplicate detection in sliding home windows over an unbounded lag of objects described in Age-Partitioned Bloom Filters: Ariel Shtul, Carlos Baquero and Paulo Sérgio Almeida, 2020.

The implementation employs the improved double hashing methodology for instantaneous index computation launched in Bloom Filters in Probabilistic Verification: Peter C. Dillinger and Panagiotis Manolios, 2004.

Occasion

// type a filter with ok=10, l=7, and g=1000
filter := apbf.Uncommon(10, 7, 1000)

merchandise := []byte("check merchandise")
filter.Add(merchandise)

if filter.Construct a question to(merchandise) {
    fmt.Println("merchandise was stumbled on")
}

Arrange

Affirm mosey discover so as to add the mission to your workspace:

mosey discover -u github.com/CrowdStrike/apbf

Benchmarks

The next outcomes point out the efficiency of predominant filter operations Add and Construct a question to with and with out refresh enabled for a minute and reliable filter. Benchmarks had been completed on a MacBook Official 2017 dev laptop laptop.

BenchmarkSmallFilterAdd-8                20000000       103 ns/op       zero B/op       zero allocs/op
BenchmarkSmallFilterAddWithRefresh-8     10000000       177 ns/op       zero B/op       zero allocs/op
BenchmarkSmallFilterQuery-8              10000000       133 ns/op       zero B/op       zero allocs/op
BenchmarkSmallFilterQueryWithRefresh-8   10000000       206 ns/op       zero B/op       zero allocs/op
BenchmarkLargeFilterAdd-8                 5000000       252 ns/op       zero B/op       zero allocs/op
BenchmarkLargeFilterAddWithRefresh-8      5000000       325 ns/op       zero B/op       zero allocs/op
BenchmarkLargeFilterQuery-8               3000000       431 ns/op       zero B/op       zero allocs/op
BenchmarkLargeFilterQueryWithRefresh-8    2000000       543 ns/op       zero B/op       zero allocs/op

Contributors

Bogdan-Ciprian Rusu – Creator/Maintainer

License

The mission is licensed under the MIT License.

LEAVE A REPLY

Please enter your comment!
Please enter your name here