From 20f6afe1c8f331f2a3ab08bbf622682e67a196b5 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 18 Sep 2012 18:40:17 -0700 Subject: [PATCH] benchmark.flip: adding a benchmark for the "flip" word. --- extra/benchmark/flip/flip.factor | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 extra/benchmark/flip/flip.factor diff --git a/extra/benchmark/flip/flip.factor b/extra/benchmark/flip/flip.factor new file mode 100644 index 0000000000..3f1b93e645 --- /dev/null +++ b/extra/benchmark/flip/flip.factor @@ -0,0 +1,13 @@ +! Copyright (C) 2012 John Benediktsson +! See http://factorcode.org/license.txt for BSD license. +USING: kernel math sequences ; +IN: benchmark.flip + +CONSTANT: my-generic { { 1 2 3 } V{ 4 5 6 } "ABC" } +CONSTANT: my-array { { 1 2 3 } { 4 5 6 } { 7 8 9 } } + +: flip-benchmark ( -- ) + 1,000,000 [ my-generic flip drop ] times + 1,000,000 [ my-array flip drop ] times ; + +MAIN: flip-benchmark