benchmark.random: no need to write the file.
Also, add random-unit and random-32 to benchmark.db4
parent
ebbfa70e87
commit
ffab88d5e9
|
@ -1,16 +1,9 @@
|
||||||
USING: io io.files io.files.temp io.encodings.ascii random
|
USING: kernel math random ;
|
||||||
math.parser math sequences ;
|
|
||||||
IN: benchmark.random
|
IN: benchmark.random
|
||||||
|
|
||||||
: random-numbers-path ( -- path )
|
|
||||||
"random-numbers.txt" temp-file ;
|
|
||||||
|
|
||||||
: write-random-numbers ( n -- )
|
|
||||||
random-numbers-path ascii [
|
|
||||||
[ 200 random 100 - number>string print ] times
|
|
||||||
] with-file-writer ;
|
|
||||||
|
|
||||||
: random-benchmark ( -- )
|
: random-benchmark ( -- )
|
||||||
300000 write-random-numbers ;
|
1,000,000 [
|
||||||
|
200 random random-unit random-32 3drop
|
||||||
|
] times ;
|
||||||
|
|
||||||
MAIN: random-benchmark
|
MAIN: random-benchmark
|
||||||
|
|
Loading…
Reference in New Issue