]> gitweb.factorcode.org Git - factor.git/commitdiff
benchmark: make it so you can select benchmarks to run
authorBjörn Lindqvist <bjourne@gmail.com>
Sun, 25 Sep 2016 18:45:52 +0000 (20:45 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Sun, 25 Sep 2016 18:47:09 +0000 (20:47 +0200)
e.g: ./factor -benchmarks="benchmark.gc1 benchmark.gc2" extra/benchmark/benchmark.factor

extra/benchmark/benchmark.factor

index 9016d3444946e2b4c3e80c78ef3b601451afafc7..4735e86647ad3e897f83bbeac08f131998c79390 100644 (file)
@@ -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 ;
+
 <PRIVATE
 
 : write-header ( str -- )