From 2752d83aca85310e6081898091f6fda0427f54c5 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 20 May 2014 19:18:39 -0700 Subject: [PATCH] benchmark.namespaces: adding a namespaces benchmark. --- extra/benchmark/namespaces/namespaces.factor | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 extra/benchmark/namespaces/namespaces.factor diff --git a/extra/benchmark/namespaces/namespaces.factor b/extra/benchmark/namespaces/namespaces.factor new file mode 100644 index 0000000000..783f9a4105 --- /dev/null +++ b/extra/benchmark/namespaces/namespaces.factor @@ -0,0 +1,29 @@ +! Copyright (C) 2014 John Benediktsson +! See http://factorcode.org/license.txt for BSD license + +USING: kernel math namespaces ; + +IN: benchmark.namespaces + +SYMBOL: foo +SYMBOL: bar +SYMBOL: baz + +: namespaces-benchmark ( -- ) + 200 [ + 123 foo [ + 200 [ + 456 bar [ + 200 [ + 789 baz [ + foo get 123 assert= + bar get 456 assert= + baz get 789 assert= + ] with-variable + ] times + ] with-variable + ] times + ] with-variable + ] times ; + +MAIN: namespaces-benchmark