From 03cd8c288df5c5f61883d421dbe4d23dc0d209ac Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 19 Jun 2012 14:09:38 -0700 Subject: [PATCH] benchmark.completion: adding a benchmark of tools.completion. --- extra/benchmark/completion/completion.factor | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 extra/benchmark/completion/completion.factor diff --git a/extra/benchmark/completion/completion.factor b/extra/benchmark/completion/completion.factor new file mode 100644 index 0000000000..1c7d921f8b --- /dev/null +++ b/extra/benchmark/completion/completion.factor @@ -0,0 +1,15 @@ + +USING: kernel sequences tools.completion ; + +IN: benchmark.completion + +: completion-benchmark ( -- ) + "nth" 25,000 [ + { + nth ?nth nths set-nth insert-nth + remove-nth remove-nth! change-nth + } + ] replicate concat [ name-completions ] keep + [ length ] bi@ assert= ; + +MAIN: completion-benchmark