Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arriqaaq/cuckoo
Implementing a Cuckoo filter, based on the paper Cuckoo Filter: Practically Better Than Bloom
https://github.com/arriqaaq/cuckoo
bloom-filter bloom-filters cuckoo-filter cuckoo-hashing-algorithm golang
Last synced: about 1 month ago
JSON representation
Implementing a Cuckoo filter, based on the paper Cuckoo Filter: Practically Better Than Bloom
- Host: GitHub
- URL: https://github.com/arriqaaq/cuckoo
- Owner: arriqaaq
- License: mit
- Created: 2018-09-27T09:41:39.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-14T08:06:07.000Z (over 2 years ago)
- Last Synced: 2024-06-19T04:24:30.423Z (5 months ago)
- Topics: bloom-filter, bloom-filters, cuckoo-filter, cuckoo-hashing-algorithm, golang
- Language: Go
- Homepage: https://medium.com/techlog/cuckoo-filter-vs-bloom-filter-from-a-gophers-perspective-94d5e6c53299
- Size: 10.7 KB
- Stars: 14
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cuckoo
Implementing a Cuckoo filter, based on the paper Cuckoo Filter: Practically Better Than Bloom## Example Usage
```go
package mainimport(
"log"
"github.com/arriqaaq/cuckoo"
)func main(){
f := cuckoo.NewCuckooFilter(uint(5000000), 0.001)
n1 := []byte("Bess")
err := f.Insert(n1)
if err!=nil{
log.Println("bucket full: ",err)
}
isPresent := f.Lookup(n1)
log.Println("key present? ",isPresent)}
```## Performance
```bash
BenchmarkCuckooAdd-4 2000000 1008 ns/op
BenchmarkCuckooTest-4 2000000 685 ns/op
BenchmarkCuckooTestAndAdd-4 1000000 1780 ns/op
BenchmarkCuckooLookupAndDelete-4 2000000 796 ns/op
```## Reference
- https://www.cs.cmu.edu/~dga/papers/cuckoo-conext2014.pdf
- https://brilliant.org/wiki/cuckoo-filter/
- https://github.com/tylertreat/BoomFilters## TODO
- Make it thread safe
- Improve hashing time, need to optimize on Insertion function