diff --git a/collects/tests/mzscheme/benchmarks/common/README.txt b/collects/tests/mzscheme/benchmarks/common/README.txt index 96a9d4dec2..cc79243730 100644 --- a/collects/tests/mzscheme/benchmarks/common/README.txt +++ b/collects/tests/mzscheme/benchmarks/common/README.txt @@ -22,7 +22,9 @@ Naming no implementation/benchmark causes a standard of them to be run implementation/benchmak starts with "no-", the default set is used minus the "no-"-specified implementation/benchmark. -The output is series of lines of the form +The output is a comment line + ; +and then a series of lines of the form [ ( ) ] where #f means that the information is unavailable, or that the benchmark wasn't run due to an implementation limitation. The diff --git a/collects/tests/mzscheme/benchmarks/common/auto.ss b/collects/tests/mzscheme/benchmarks/common/auto.ss index f8f8de6ea7..40e2af1afa 100755 --- a/collects/tests/mzscheme/benchmarks/common/auto.ss +++ b/collects/tests/mzscheme/benchmarks/common/auto.ss @@ -9,6 +9,7 @@ exec mzscheme -qu "$0" ${1+"$@"} (lib "list.ss") (lib "compile.ss") (lib "inflate.ss") + (lib "date.ss") (lib "file.ss" "dynext")) ;; Implementaton-specific control functions ------------------------------ @@ -233,7 +234,7 @@ exec mzscheme -qu "$0" ${1+"$@"} i)) impls)]) (if (memq bm (impl-skips i)) - (printf "[~a ~a ~s #f]\n" impl bm '(#f #f #f)) + (rprintf "[~a ~a ~s #f]\n" impl bm '(#f #f #f)) (let ([start (current-inexact-milliseconds)]) ((impl-make i) bm) (let ([end (current-inexact-milliseconds)]) @@ -244,7 +245,7 @@ exec mzscheme -qu "$0" ${1+"$@"} [current-error-port out]) ((impl-run i) bm)) (error 'auto "~a\nrun failed ~a" (get-output-bytes out) bm)) - (printf "[~a ~a ~s ~a]\n" + (rprintf "[~a ~a ~s ~a]\n" impl bm ((impl-extract-result i) bm (get-output-bytes out)) @@ -253,6 +254,14 @@ exec mzscheme -qu "$0" ${1+"$@"} ((impl-clean-up i) bm))) (flush-output))) + (define (rprintf . args) + (apply printf args) + (when (current-output-file) + (with-output-to-file (current-output-file) + (lambda () + (apply printf args)) + 'append))) + (define no-implementations (map (lambda (s) (cons (string->symbol (format "no-~a" s)) s)) @@ -269,6 +278,8 @@ exec mzscheme -qu "$0" ${1+"$@"} (define default-implementations (remq* obsolte-impls (map impl-name impls))) + (define current-output-file (make-parameter #f)) + ;; Extract command-line arguments -------------------- (define args @@ -288,6 +299,8 @@ exec mzscheme -qu "$0" ${1+"$@"} (for-each (lambda (bm) (printf " ~a\n" bm)) benchmarks)] + [("-o" "--out") filename "append output to " + (current-output-file filename)] [("-n" "--iters") n "set number of run iterations" (let ([v (string->number n)]) (unless (and (number? v) @@ -340,6 +353,8 @@ exec mzscheme -qu "$0" ${1+"$@"} ;; Run benchmarks ------------------------------- + (rprintf "; ~a\n" (date->string (seconds->date (current-seconds)) #t)) + (map (lambda (impl) (map (lambda (bm) (run-benchmark impl bm))