benchmark.bloom-filters: more iterations now bloom-filters are faster.

db4
John Benediktsson 2013-04-04 07:10:30 -07:00
parent 1cd3be1fb2
commit 812c3e4cdf
1 changed files with 11 additions and 5 deletions

View File

@ -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