From e3153e6d213fe3ce7deca3b2e2ee224c15cf42fc Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Tue, 16 Nov 2010 16:29:38 -0700 Subject: [PATCH] Adding normalization display --- collects/tests/stress.rkt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/collects/tests/stress.rkt b/collects/tests/stress.rkt index 284b301a34..3aa0733e19 100644 --- a/collects/tests/stress.rkt +++ b/collects/tests/stress.rkt @@ -70,8 +70,25 @@ #:key (λ (v) (vector-ref v 1)))) (define (stress-display how-many res) + (define-values + (min-cpu min-real min-gc) + (for/fold ([min-cpu +inf.0] + [min-real +inf.0] + [min-gc +inf.0]) + ([v (in-list res)]) + (match-define (vector label cpu real gc) v) + (printf "~a: cpu: ~a real: ~a gc: ~a (averaged over ~a runs)\n" + label cpu real gc how-many) + (values (min min-cpu cpu) + (min min-real real) + (min min-gc gc)))) + (define (norm min x) + (if (zero? min) + "inf" + (real->decimal-string (/ x min)))) + (printf "Normalized:\n") (for ([v (in-list res)]) (match-define (vector label cpu real gc) v) (printf "~a: cpu: ~a real: ~a gc: ~a (averaged over ~a runs)\n" - label cpu real gc how-many)) + label (norm min-cpu cpu) (norm min-real real) (norm min-gc gc) how-many)) (newline)) \ No newline at end of file