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