From ffab88d5e97d5a1f9bd7afe23d9d094afbd257d9 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Thu, 6 Sep 2012 07:53:41 -0700 Subject: [PATCH] benchmark.random: no need to write the file. Also, add random-unit and random-32 to benchmark. --- extra/benchmark/random/random.factor | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/extra/benchmark/random/random.factor b/extra/benchmark/random/random.factor index adfa564f4b..1f185a1c32 100644 --- a/extra/benchmark/random/random.factor +++ b/extra/benchmark/random/random.factor @@ -1,16 +1,9 @@ -USING: io io.files io.files.temp io.encodings.ascii random -math.parser math sequences ; +USING: kernel math 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 ( -- ) - 300000 write-random-numbers ; + 1,000,000 [ + 200 random random-unit random-32 3drop + ] times ; MAIN: random-benchmark