]> gitweb.factorcode.org Git - factor.git/commitdiff
benchmark.sort: make the numbers-to-sort at parse time...
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 6 Sep 2012 14:54:29 +0000 (07:54 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 6 Sep 2012 14:54:29 +0000 (07:54 -0700)
extra/benchmark/sort/sort.factor

index 4171bb71963120927c82ace21ef37a8536388260..2bf9df3251bb37d83e8bf2d390a3975ec39fa473 100644 (file)
@@ -1,9 +1,10 @@
-USING: io.files io.encodings.ascii kernel math math.parser
-random sequences sorting ;
+USING: io.files io.encodings.ascii kernel literals math
+math.parser random sequences sorting ;
 IN: benchmark.sort
 
+CONSTANT: numbers-to-sort $[ 300,000 200 random-integers ]
+
 : sort-benchmark ( -- )
-    10 300000 200 random-integers
-    [ natural-sort drop ] curry times ;
+    10 [ numbers-to-sort natural-sort drop ] times ;
 
 MAIN: sort-benchmark