apppend unexposed bugs to the rhs of the benchmark plot

This commit is contained in:
Burke Fetscher 2014-03-22 15:28:29 -05:00
parent 94a5f215b1
commit 0f5be21f21

View File

@ -1,6 +1,7 @@
#lang racket/base #lang racket/base
(require plot/pict (require "apply-diffs.rkt"
plot/pict
racket/cmdline racket/cmdline
racket/list racket/list
racket/match racket/match
@ -65,6 +66,21 @@
29 2.045 29 2.045
30 2.042)) 30 2.042))
(define (bug-file? f)
(define m (regexp-match #rx"^.*/(.*-[0-9]\\.rkt)$"
(path->string f)))
(and m
(second m)))
(define (all-bug-files)
(sort
(flatten
(for/list ([d (in-list (get-directories directories))])
(for/list ([f (in-directory d)]
#:when (bug-file? f))
(bug-file? f))))
string<?))
(define (make-plot filenames) (define (make-plot filenames)
(parameterize ([plot-x-tick-label-angle 75] (parameterize ([plot-x-tick-label-angle 75]
[plot-x-tick-label-anchor 'right] [plot-x-tick-label-anchor 'right]
@ -101,6 +117,9 @@
(/ (stddev times #:bias #t) (sqrt (length times))))) (/ (stddev times #:bias #t) (sqrt (length times)))))
(define name-avgs (make-hash)) (define name-avgs (make-hash))
(for ([b (in-list (all-bug-files))])
(hash-set! name-avgs b '()))
(define data-stats (define data-stats
(let loop ([d data] (let loop ([d data]
@ -131,19 +150,30 @@
0 0
(error-bar times))))]))) (error-bar times))))])))
(define (name-order name)
(length (define name-order
(or ;; this function is mysteriously called a LOT...
(memf (let ([memo (make-hash)])
(λ (n) (equal? n name)) (λ (name)
(sort (hash-keys name-avgs) (hash-ref memo name
> (λ ()
#:key (λ (k) (define ans
(define val (hash-ref name-avgs k)) (length
(if (number? val) (or
val (memf
(mean val))))) (λ (n) (equal? n name))
'()))) (sort (sort (hash-keys name-avgs)
string>?)
>
#:key (λ (k)
(define val (hash-ref name-avgs k))
(cond
[(number? val) val]
[(empty? val) +inf.0]
[else (mean val)]))))
'())))
(hash-set! memo name ans)
ans)))))
(define (get-name-num name n) (define (get-name-num name n)
(+ (if (offset?) (+ (if (offset?)
@ -162,7 +192,7 @@
(and (equal? type (list-ref l 1)) (and (equal? type (list-ref l 1))
(list-ref l 2))) (list-ref l 2)))
data-stats))) data-stats)))
(list (define ps
(points (points
(map (map
(λ (l) (λ (l)
@ -173,16 +203,19 @@
#:sym (hash-ref type-symbols type) #:sym (hash-ref type-symbols type)
#:size 20 #:size 20
#:line-width 2 #:line-width 2
#:color (add1 n)) #:color (add1 n)))
(error-bars (if (equal? type 'ordered)
(map (λ (d) ps
(list (get-name-num (list-ref d 0) n) (list ps
(list-ref d 2) (error-bars
(list-ref d 3))) (map (λ (d)
this-type) (list (get-name-num (list-ref d 0) n)
#:y-min 0.01 (list-ref d 2)
#:line-width 1 (list-ref d 3)))
#:color (length (member type all-types))))) this-type)
#:y-min 0.01
#:line-width 1
#:color (length (member type all-types))))))
(define (zero->neg n) (define (zero->neg n)
(if (zero? n) (if (zero? n)