1 USING: cuckoo-filters endian fry kernel math sequences ;
2 IN: benchmark.cuckoo-filters
4 : insert-data ( cuckoo-filter -- cuckoo-filter )
5 2,000 <iota> [ 4 >le ] map
6 10 swap '[ _ [ over cuckoo-insert drop ] each ] times ;
8 : test-hit ( cuckoo-filter -- cuckoo-filter )
9 10,000 100 4 >le '[ _ over cuckoo-lookup drop ] times ;
11 : test-miss ( cuckoo-filter -- cuckoo-filter )
12 100,000 12345 4 >le '[ _ over cuckoo-lookup drop ] times ;
14 : cuckoo-filters-benchmark ( -- )
15 2000 <cuckoo-filter> insert-data test-hit test-miss drop ;
17 MAIN: cuckoo-filters-benchmark