From 3928e5cb268c1a0585765635fda5887e2ccbb933 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Wed, 11 Jul 2012 18:43:22 -0700 Subject: [PATCH] benchmark.json: adding a json benchmark. --- extra/benchmark/json/json.factor | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 extra/benchmark/json/json.factor diff --git a/extra/benchmark/json/json.factor b/extra/benchmark/json/json.factor new file mode 100644 index 0000000000..2f6e3f762b --- /dev/null +++ b/extra/benchmark/json/json.factor @@ -0,0 +1,11 @@ +! Copyright (C) 2012 John Benediktsson +! See http://factorcode.org/license.txt for BSD license. +USING: assocs json.reader json.writer kernel math math.parser +sequences ; +IN: benchmark.json + +: json-benchmark ( -- ) + 200 iota [ [ number>string ] keep ] H{ } map>assoc + 1,000 [ >json json> ] times drop ; + +MAIN: json-benchmark