benchmark.bloom-filters: more iterations now bloom-filters are faster.
parent
1cd3be1fb2
commit
812c3e4cdf
|
@ -1,11 +1,17 @@
|
|||
USING: bloom-filters kernel math ;
|
||||
USING: bloom-filters kernel math sequences ;
|
||||
|
||||
IN: benchmark.bloom-filters
|
||||
|
||||
: insert-data ( bloom-filter -- bloom-filter )
|
||||
100 [ 2,000 iota [ over bloom-filter-insert ] each ] times ;
|
||||
|
||||
: test-hit ( bloom-filter -- bloom-filter )
|
||||
100,000 [ 100 over bloom-filter-member? drop ] times ;
|
||||
|
||||
: test-miss ( bloom-filter -- bloom-filter )
|
||||
1,000,000 [ 12345 over bloom-filter-member? drop ] times ;
|
||||
|
||||
: bloom-filters-benchmark ( -- )
|
||||
0.01 2000 <bloom-filter> 100,000 [
|
||||
100 over bloom-filter-insert
|
||||
100 over bloom-filter-member? drop
|
||||
] times drop ;
|
||||
0.01 2000 <bloom-filter> insert-data test-hit test-miss drop ;
|
||||
|
||||
MAIN: bloom-filters-benchmark
|
||||
|
|
Loading…
Reference in New Issue