From e32e45e59062ba4c9c75415c11ed81f069d8302f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Sun, 25 Sep 2016 20:45:52 +0200 Subject: [PATCH] benchmark: make it so you can select benchmarks to run e.g: ./factor -benchmarks="benchmark.gc1 benchmark.gc2" extra/benchmark/benchmark.factor --- extra/benchmark/benchmark.factor | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/extra/benchmark/benchmark.factor b/extra/benchmark/benchmark.factor index 9016d34449..4735e86647 100644 --- a/extra/benchmark/benchmark.factor +++ b/extra/benchmark/benchmark.factor @@ -1,8 +1,9 @@ ! Copyright (C) 2007, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays assocs continuations debugger formatting fry help.markup -io io.styles kernel math memory prettyprint sequences -tools.profiler.sampling tools.test tools.time vocabs.hierarchy vocabs.loader ; +io io.styles kernel math memory namespaces prettyprint sequences +splitting tools.profiler.sampling tools.test tools.time +vocabs.hierarchy vocabs.loader ; IN: benchmark : run-timing-benchmark ( vocab -- time ) @@ -11,9 +12,12 @@ IN: benchmark : run-profile-benchmark ( vocab -- profile ) compact-gc '[ _ run ] profile most-recent-profile-data ; -: find-benchmark-vocabs ( -- seq ) +: all-benchmark-vocabs ( -- seq ) "benchmark" disk-child-vocab-names [ find-vocab-root ] filter ; +: find-benchmark-vocabs ( -- seq ) + "benchmarks" get " " split harvest [ all-benchmark-vocabs ] when-empty ; +