]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/sort/sort.factor
core: Rename iota to <iota> so we can have TUPLE: iota ... ; instead of TUPLE: iota...
[factor.git] / extra / benchmark / sort / sort.factor
1 USING: assocs kernel literals math random sequences sorting ;
2 IN: benchmark.sort
3
4 CONSTANT: numbers-to-sort $[ 300,000 200 random-integers ]
5 CONSTANT: alist-to-sort $[ 1,000 <iota> dup zip ]
6
7 : sort-benchmark ( -- )
8     10 [ numbers-to-sort natural-sort drop ] times
9     5,000 [ alist-to-sort sort-keys drop ] times ;
10
11 MAIN: sort-benchmark