Force primes list evaluation before benchmark

db4
Samuel Tardieu 2008-12-29 21:29:26 +01:00
parent f521805bb3
commit c1c1ebf3d4
1 changed files with 4 additions and 1 deletions

View File

@ -1,10 +1,13 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: binary-search math.primes.list math.ranges sequences
USING: binary-search kernel math.primes.list math.ranges sequences
prettyprint ;
IN: benchmark.binary-search
: binary-search-benchmark ( -- )
1 1000000 [a,b] [ primes-under-million sorted-member? ] map length . ;
! Force computation of the primes list before benchmarking the binary search
primes-under-million drop
MAIN: binary-search-benchmark