benchmark.sort: slow down sorting to test sorting alists.

db4
John Benediktsson 2013-03-20 17:11:54 -07:00
parent c1cfb50728
commit b981973938
1 changed files with 4 additions and 3 deletions

View File

@ -1,10 +1,11 @@
USING: io.files io.encodings.ascii kernel literals math
math.parser random sequences sorting ;
USING: assocs kernel literals math random sequences sorting ;
IN: benchmark.sort
CONSTANT: numbers-to-sort $[ 300,000 200 random-integers ]
CONSTANT: alist-to-sort $[ 1,000 iota dup zip ]
: sort-benchmark ( -- )
10 [ numbers-to-sort natural-sort drop ] times ;
10 [ numbers-to-sort natural-sort drop ] times
5,000 [ alist-to-sort sort-keys drop ] times ;
MAIN: sort-benchmark