From b981973938c1216ea8785543c105ce157178c06c Mon Sep 17 00:00:00 2001 From: John Benediktsson <mrjbq7@gmail.com> Date: Wed, 20 Mar 2013 17:11:54 -0700 Subject: [PATCH] benchmark.sort: slow down sorting to test sorting alists. --- extra/benchmark/sort/sort.factor | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extra/benchmark/sort/sort.factor b/extra/benchmark/sort/sort.factor index 2bf9df3251..c3f8ae32d0 100644 --- a/extra/benchmark/sort/sort.factor +++ b/extra/benchmark/sort/sort.factor @@ -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