benchmark: rename (run-benchmark) to run-benchmark, and run-benchmark to record-benchmark, since (run-benchmark) was actually useful on its own

db4
Slava Pestov 2009-09-10 18:32:45 -05:00
parent d5bc1ceca2
commit cffa0c2b4f
1 changed files with 7 additions and 3 deletions

View File

@ -12,23 +12,27 @@ SYMBOL: errors
PRIVATE> PRIVATE>
: (run-benchmark) ( vocab -- time ) : run-benchmark ( vocab -- time )
[ 5 ] dip '[ gc [ _ run ] benchmark ] replicate infimum ; [ 5 ] dip '[ gc [ _ run ] benchmark ] replicate infimum ;
: run-benchmark ( vocab -- ) <PRIVATE
: record-benchmark ( vocab -- )
[ "=== " write print flush ] [ [ "=== " write print flush ] [
[ [ require ] [ (run-benchmark) ] [ ] tri timings ] [ [ require ] [ (run-benchmark) ] [ ] tri timings ]
[ swap errors ] [ swap errors ]
recover get set-at recover get set-at
] bi ; ] bi ;
PRIVATE>
: run-benchmarks ( -- timings errors ) : run-benchmarks ( -- timings errors )
[ [
V{ } clone timings set V{ } clone timings set
V{ } clone errors set V{ } clone errors set
"benchmark" child-vocab-names "benchmark" child-vocab-names
[ find-vocab-root ] filter [ find-vocab-root ] filter
[ run-benchmark ] each [ record-benchmark ] each
timings get timings get
errors get errors get
] with-scope ; ] with-scope ;