Remove "primes-under-million" list
In the past, this was a static list used to optimize prime factors computation. Now that the dependency has been reversed, there is no point in keeping this list which can be obtained by "1000000 primes-upto" as easily.db4
parent
2638db02d1
commit
c8be645eb1
|
@ -1,13 +1,17 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: binary-search kernel math.primes.list math.ranges sequences
|
USING: binary-search compiler.units kernel math.primes math.ranges
|
||||||
prettyprint ;
|
memoize prettyprint sequences ;
|
||||||
IN: benchmark.binary-search
|
IN: benchmark.binary-search
|
||||||
|
|
||||||
: binary-search-benchmark ( -- )
|
[
|
||||||
1 1000000 [a,b] [ primes-under-million sorted-member? ] map length . ;
|
MEMO: primes-under-million ( -- seq ) 1000000 primes-upto ;
|
||||||
|
] with-compilation-unit
|
||||||
|
|
||||||
! Force computation of the primes list before benchmarking the binary search
|
! Force computation of the primes list before benchmarking the binary search
|
||||||
primes-under-million drop
|
primes-under-million drop
|
||||||
|
|
||||||
|
: binary-search-benchmark ( -- )
|
||||||
|
1 1000000 [a,b] [ primes-under-million sorted-member? ] map length . ;
|
||||||
|
|
||||||
MAIN: binary-search-benchmark
|
MAIN: binary-search-benchmark
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Doug Coleman
|
|
|
@ -1,4 +0,0 @@
|
||||||
USING: math.primes memoize ;
|
|
||||||
IN: math.primes.list
|
|
||||||
|
|
||||||
MEMO: primes-under-million ( -- seq ) 1000000 primes-upto ;
|
|
Loading…
Reference in New Issue