Also, add random-unit and random-32 to benchmark.
-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