fix benchmark harness for compiled test directories
The benchmark harness was written with the assumption that "compiled" would not exist, but compilation of tests is enabled by default.
This commit is contained in:
parent
b22b23a8aa
commit
425ed7b292
|
@ -46,14 +46,17 @@ exec racket -qu "$0" ${1+"$@"}
|
|||
[read-accept-reader #t])
|
||||
(let ([name (format "~a.rkt" bm)])
|
||||
(compile-file name
|
||||
(build-path "compiled" (path-add-suffix name #".zo"))))))
|
||||
"compiled/current-bm_rkt.zo"))))
|
||||
|
||||
(define (compiled-path bm)
|
||||
"current-bm.rkt")
|
||||
|
||||
(define (mk-mz-old bm)
|
||||
(system (format "mz-old -l- raco make ~a.rkt" bm)))
|
||||
|
||||
(define (clean-up-zo bm)
|
||||
(when (directory-exists? "compiled")
|
||||
(delete-directory/files "compiled")))
|
||||
(when (file-exists? "compiled/current-bm_rkt.zo")
|
||||
(delete-file "compiled/current-bm_rkt.zo")))
|
||||
|
||||
(define (mk-typed-racket-non-optimizing bm)
|
||||
(unless (directory-exists? "typed/compiled")
|
||||
|
@ -364,7 +367,7 @@ exec racket -qu "$0" ${1+"$@"}
|
|||
void
|
||||
mk-racket
|
||||
(lambda (bm)
|
||||
(system* (find-exe) "-u" (format "~a.rkt" bm)))
|
||||
(system* (find-exe) "-u" (compiled-path bm)))
|
||||
extract-racket-times
|
||||
clean-up-zo
|
||||
racket-skip-progs)
|
||||
|
@ -380,7 +383,7 @@ exec racket -qu "$0" ${1+"$@"}
|
|||
void
|
||||
mk-racket
|
||||
(lambda (bm)
|
||||
(system (format "racketcgc -u ~a.rkt" bm)))
|
||||
(system (format "racketcgc -u ~a" (compiled-path bm))))
|
||||
extract-racket-times
|
||||
clean-up-zo
|
||||
racket-skip-progs)
|
||||
|
@ -388,7 +391,7 @@ exec racket -qu "$0" ${1+"$@"}
|
|||
void
|
||||
mk-racket
|
||||
(lambda (bm)
|
||||
(system (format "racket3m -u ~a.rkt" bm)))
|
||||
(system (format "racket3m -u ~a" (compiled-path bm))))
|
||||
extract-racket-times
|
||||
clean-up-zo
|
||||
racket-skip-progs)
|
||||
|
@ -415,7 +418,7 @@ exec racket -qu "$0" ${1+"$@"}
|
|||
void
|
||||
mk-racket
|
||||
(lambda (bm)
|
||||
(system (format "racket -jqu ~a.rkt" bm)))
|
||||
(system (format "racket -jqu ~a" (compiled-path bm))))
|
||||
extract-racket-times
|
||||
clean-up-zo
|
||||
racket-skip-progs)
|
||||
|
@ -423,7 +426,7 @@ exec racket -qu "$0" ${1+"$@"}
|
|||
void
|
||||
mk-racket
|
||||
(lambda (bm)
|
||||
(system (format "racketcgc -jqu ~a.rkt" bm)))
|
||||
(system (format "racketcgc -jqu ~a" (compiled-path bm))))
|
||||
extract-racket-times
|
||||
clean-up-zo
|
||||
racket-skip-progs)
|
||||
|
|
|
@ -40,11 +40,11 @@ exec racket -qu "$0" ${1+"$@"}
|
|||
[read-accept-reader #t])
|
||||
(let ([name (format "~a.rkt" bm)])
|
||||
(compile-file name
|
||||
(build-path "compiled" (path-add-suffix name #".zo"))))))
|
||||
"compiled/current-bm_rkt.zo"))))
|
||||
|
||||
(define (clean-up-zo bm)
|
||||
(when (directory-exists? "compiled")
|
||||
(delete-directory/files "compiled")))
|
||||
(when (file-exists? "compiled/current-bm_rkt.zo")
|
||||
(delete-file "compiled/current-bm_rkt.zo")))
|
||||
|
||||
(define (mk-typed-racket-non-optimizing bm)
|
||||
(unless (directory-exists? "typed/compiled")
|
||||
|
@ -53,7 +53,7 @@ exec racket -qu "$0" ${1+"$@"}
|
|||
[read-accept-reader #t])
|
||||
(let ([name (format "~a-non-optimizing.rkt" bm)])
|
||||
(compile-file (format "typed/~a" name)
|
||||
(build-path "typed/compiled" (path-add-suffix name #".zo"))))))
|
||||
"typed/compiled/current-bm_rkt.zo"))))
|
||||
(define (mk-typed-racket bm)
|
||||
(unless (directory-exists? "typed/compiled")
|
||||
(make-directory "typed/compiled"))
|
||||
|
@ -61,11 +61,11 @@ exec racket -qu "$0" ${1+"$@"}
|
|||
[read-accept-reader #t])
|
||||
(let ([name (format "~a-optimizing.rkt" bm)])
|
||||
(compile-file (format "typed/~a" name)
|
||||
(build-path "typed/compiled" (path-add-suffix name #".zo"))))))
|
||||
"typed/compiled/current-bm_rkt.zo"))))
|
||||
|
||||
(define (clean-up-typed bm)
|
||||
(when (directory-exists? "typed/compiled")
|
||||
(delete-directory/files "typed/compiled")))
|
||||
(when (file-exists? "typed/compiled/current-bm_rkt.zo")
|
||||
(delete-file "typed/compiled/current-bm_rkt.zo")))
|
||||
|
||||
(define (extract-racket-times bm str)
|
||||
(let ([m (regexp-match #rx#"cpu time: ([0-9]+) real time: ([0-9]+) gc time: ([0-9]+)" str)])
|
||||
|
|
|
@ -137,9 +137,9 @@
|
|||
(vector-ref (current-command-line-arguments) 1))]
|
||||
[bench (vector-ref (current-command-line-arguments) 0)]
|
||||
[prog (cond
|
||||
((string=? version "racket") (format "~a.rkt" bench))
|
||||
((string=? version "typed-racket-non-optimizing") (format "typed/~a-non-optimizing.rkt" bench))
|
||||
((string=? version "typed-racket") (format "typed/~a-optimizing.rkt" bench))
|
||||
((string=? version "racket") "current-bm.rkt")
|
||||
((string=? version "typed-racket-non-optimizing") "typed/current-bm.rkt")
|
||||
((string=? version "typed-racket") "typed/current-bm.rkt")
|
||||
(else (error 'run "unknown version ~a" version)))])
|
||||
(let ([m (assoc bench input-map)])
|
||||
(unless m
|
||||
|
|
Loading…
Reference in New Issue
Block a user