* Fixed benchmarks to work on (rnrs) libraries instead of the old

(r6rs) libraries.
This commit is contained in:
Abdulaziz Ghuloum 2007-11-04 12:03:32 -05:00
parent 6348eb9918
commit ab282428fe
69 changed files with 196 additions and 190 deletions

View File

@ -1,14 +1,13 @@
* maze needs bitwise-and * maze needs bitwise-and
* quicksort needs bignum modulo. * quicksort needs bignum modulo.
* scheme needs complex? and other stuff.
* compiler needs string-downcase * compiler needs string-downcase
* nbody needs real-part * nbody needs real-part, make-polar
* ntakl kinda slow * ntakl kinda slow
* string too slow * string too slow
* nbody does not work * nbody does not work
* fibfp does not terminate * fibfp does not terminate (not anymore)
* mbrot too slow * mbrot too slow
* pnpoly kinda slow * pnpoly kinda slow
* sumfp/fpsum too slow * sumfp/fpsum too slow

View File

@ -7,7 +7,7 @@
(lambda () (lambda ()
(eval 'main (eval 'main
(environment (environment
(list 'r6rs-benchmarks name)))))]) (list 'rnrs-benchmarks name)))))])
(proc))) (proc)))
(apply (apply

View File

@ -1,5 +0,0 @@
(library (r6rs-benchmarks dynamic)
(export main)
(import (r6rs) (r6rs mutable-pairs) (r6rs-benchmarks))
(include-source "dynamic.src.ss"))

View File

@ -1,5 +1,5 @@
(library (r6rs-benchmarks) (library (rnrs-benchmarks)
(export run-benchmark fatal-error include-source (export run-benchmark fatal-error include-source
call-with-output-file/truncate call-with-output-file/truncate
ack-iters ack-iters
@ -27,8 +27,10 @@
graphs-iters graphs-iters
lattice-iters lattice-iters
matrix-iters matrix-iters
maze-iters
mazefun-iters mazefun-iters
mbrot-iters mbrot-iters
nbody-iters
nboyer-iters nboyer-iters
nqueens-iters nqueens-iters
nucleic-iters nucleic-iters
@ -44,6 +46,7 @@
quicksort-iters quicksort-iters
ray-iters ray-iters
sboyer-iters sboyer-iters
scheme-iters
simplex-iters simplex-iters
slatex-iters slatex-iters
sum-iters sum-iters
@ -168,6 +171,6 @@
(define quicksort-iters 1) (define quicksort-iters 1)
(define fpsum-iters 10) (define fpsum-iters 10)
;(define nbody-iters 1) ; nondeterministic (order of evaluation) (define nbody-iters 1) ; nondeterministic (order of evaluation)
) )

View File

@ -1,8 +1,8 @@
;;; ACK -- One of the Kernighan and Van Wyk benchmarks. ;;; ACK -- One of the Kernighan and Van Wyk benchmarks.
(library (r6rs-benchmarks ack) (library (rnrs-benchmarks ack)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (ack m n) (define (ack m n)
(cond ((= m 0) (+ n 1)) (cond ((= m 0) (+ n 1))

View File

@ -1,8 +1,8 @@
;;; ARRAY1 -- One of the Kernighan and Van Wyk benchmarks. ;;; ARRAY1 -- One of the Kernighan and Van Wyk benchmarks.
(library (r6rs-benchmarks array1) (library (rnrs-benchmarks array1)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (create-x n) (define (create-x n)
(define result (make-vector n)) (define result (make-vector n))

View File

@ -1,11 +1,11 @@
;;; BOYER -- Logic programming benchmark, originally written by Bob Boyer. ;;; BOYER -- Logic programming benchmark, originally written by Bob Boyer.
;;; Fairly CONS intensive. ;;; Fairly CONS intensive.
(library (r6rs-benchmarks boyer) (library (rnrs-benchmarks boyer)
(export main) (export main)
(import (r6rs) (import (rnrs)
(r6rs mutable-pairs) (rnrs mutable-pairs)
(r6rs-benchmarks)) (rnrs-benchmarks))
(define (lookup key table) (define (lookup key table)
(let loop ((x table)) (let loop ((x table))

View File

@ -1,11 +1,11 @@
;;; BROWSE -- Benchmark to create and browse through ;;; BROWSE -- Benchmark to create and browse through
;;; an AI-like data base of units. ;;; an AI-like data base of units.
(library (r6rs-benchmarks browse) (library (rnrs-benchmarks browse)
(export main) (export main)
(import (r6rs) (import (rnrs)
(r6rs mutable-pairs) (rnrs mutable-pairs)
(r6rs-benchmarks)) (rnrs-benchmarks))
(define (lookup key table) (define (lookup key table)
(let loop ((x table)) (let loop ((x table))

View File

@ -1,8 +1,8 @@
;;; CAT -- One of the Kernighan and Van Wyk benchmarks. ;;; CAT -- One of the Kernighan and Van Wyk benchmarks.
(library (r6rs-benchmarks cat) (library (rnrs-benchmarks cat)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define inport #f) (define inport #f)
(define outport #f) (define outport #f)

View File

@ -1,8 +1,8 @@
;(define integer->char ascii->char) ;(define integer->char ascii->char)
;(define char->integer char->ascii) ;(define char->integer char->ascii)
(library (r6rs-benchmarks compiler) (library (rnrs-benchmarks compiler)
(export main) (export main)
(import (r6rs) (r6rs mutable-pairs) (r6rs-benchmarks)) (import (rnrs) (rnrs mutable-pairs) (rnrs-benchmarks))
(define open-input-file* open-input-file) (define open-input-file* open-input-file)
(define (pp-expression expr port) (write expr port) (newline port)) (define (pp-expression expr port) (write expr port) (newline port))

View File

@ -1,11 +1,11 @@
;;; CONFORM -- Type checker, written by Jim Miller. ;;; CONFORM -- Type checker, written by Jim Miller.
(library (r6rs-benchmarks conform) (library (rnrs-benchmarks conform)
(export main) (export main)
(import (r6rs) (import (rnrs)
(r6rs unicode) (rnrs unicode)
(r6rs mutable-pairs) (rnrs mutable-pairs)
(r6rs-benchmarks)) (rnrs-benchmarks))
;;; Functional and unstable ;;; Functional and unstable

View File

@ -1,9 +1,9 @@
;;; CPSTAK -- A continuation-passing version of the TAK benchmark. ;;; CPSTAK -- A continuation-passing version of the TAK benchmark.
;;; A good test of first class procedures and tail recursion. ;;; A good test of first class procedures and tail recursion.
(library (r6rs-benchmarks cpstak) (library (rnrs-benchmarks cpstak)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (cpstak x y z) (define (cpstak x y z)

View File

@ -1,8 +1,8 @@
;;; CTAK -- A version of the TAK procedure that uses continuations. ;;; CTAK -- A version of the TAK procedure that uses continuations.
(library (r6rs-benchmarks ctak) (library (rnrs-benchmarks ctak)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (ctak x y z) (define (ctak x y z)
(call-with-current-continuation (call-with-current-continuation

View File

@ -3,9 +3,9 @@
;;; Returns the wrong answer for quotients. ;;; Returns the wrong answer for quotients.
;;; Fortunately these aren't used in the benchmark. ;;; Fortunately these aren't used in the benchmark.
(library (r6rs-benchmarks dderiv) (library (rnrs-benchmarks dderiv)
(export main) (export main)
(import (r6rs) (r6rs mutable-pairs) (r6rs-benchmarks)) (import (rnrs) (rnrs mutable-pairs) (rnrs-benchmarks))
(define (lookup key table) (define (lookup key table)
(let loop ((x table)) (let loop ((x table))

View File

@ -1,8 +1,8 @@
;;; DERIV -- Symbolic derivation. ;;; DERIV -- Symbolic derivation.
(library (r6rs-benchmarks deriv) (library (rnrs-benchmarks deriv)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
;;; Returns the wrong answer for quotients. ;;; Returns the wrong answer for quotients.
;;; Fortunately these aren't used in the benchmark. ;;; Fortunately these aren't used in the benchmark.

View File

@ -1,10 +1,10 @@
;;; DESTRUC -- Destructive operation benchmark. ;;; DESTRUC -- Destructive operation benchmark.
(library (r6rs-benchmarks destruc) (library (rnrs-benchmarks destruc)
(export main) (export main)
(import (r6rs) (import (rnrs)
(r6rs mutable-pairs) (rnrs mutable-pairs)
(r6rs-benchmarks)) (rnrs-benchmarks))
(define (append-to-tail! x y) (define (append-to-tail! x y)
(if (null? x) (if (null? x)

View File

@ -1,8 +1,8 @@
;;; DIVITER -- Benchmark which divides by 2 using lists of n ()'s. ;;; DIVITER -- Benchmark which divides by 2 using lists of n ()'s.
(library (r6rs-benchmarks diviter) (library (rnrs-benchmarks diviter)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (create-n n) (define (create-n n)
(do ((n n (- n 1)) (do ((n n (- n 1))

View File

@ -1,8 +1,8 @@
;;; DIVREC -- Benchmark which divides by 2 using lists of n ()'s. ;;; DIVREC -- Benchmark which divides by 2 using lists of n ()'s.
(library (r6rs-benchmarks divrec) (library (rnrs-benchmarks divrec)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (create-n n) (define (create-n n)
(do ((n n (- n 1)) (do ((n n (- n 1))

View File

@ -2306,7 +2306,7 @@
(define doit (define doit
(lambda () (lambda ()
(i!) (i!)
(let ((foo (dynamic-parse-file "r6rs-benchmarks/dynamic.src.ss"))) (let ((foo (dynamic-parse-file "rnrs-benchmarks/dynamic.src.ss")))
(normalize-global-constraints!) (normalize-global-constraints!)
(reset-counters!) (reset-counters!)
(tag-ast*-show foo) (tag-ast*-show foo)

View File

@ -0,0 +1,5 @@
(library (rnrs-benchmarks dynamic)
(export main)
(import (rnrs) (rnrs mutable-pairs) (rnrs-benchmarks))
(include-source "dynamic.src.ss"))

View File

@ -123,9 +123,9 @@
; Enders of V = (5 19 20) ; Enders of V = (5 19 20)
; Predictors of V = (15 17) ; Predictors of V = (15 17)
(library (r6rs-benchmarks earley) (library (rnrs-benchmarks earley)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (make-parser grammar lexer) (define (make-parser grammar lexer)

View File

@ -1,8 +1,8 @@
;;; FFT - Fast Fourier Transform, translated from "Numerical Recipes in C" ;;; FFT - Fast Fourier Transform, translated from "Numerical Recipes in C"
(library (r6rs-benchmarks fft) (library (rnrs-benchmarks fft)
(export main) (export main)
(import (r6rs) (r6rs arithmetic flonums) (r6rs-benchmarks)) (import (rnrs) (rnrs arithmetic flonums) (rnrs-benchmarks))
;(define flsin sin) ;(define flsin sin)

View File

@ -1,8 +1,8 @@
;;; FIB -- A classic benchmark, computes fib(35) inefficiently. ;;; FIB -- A classic benchmark, computes fib(35) inefficiently.
(library (r6rs-benchmarks fib) (library (rnrs-benchmarks fib)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (fib n) (define (fib n)
(if (< n 2) (if (< n 2)

View File

@ -1,8 +1,8 @@
;;; FIBC -- FIB using first-class continuations, written by Kent Dybvig ;;; FIBC -- FIB using first-class continuations, written by Kent Dybvig
(library (r6rs-benchmarks fibc) (library (rnrs-benchmarks fibc)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (_1+ n) (+ n 1)) (define (_1+ n) (+ n 1))
(define (_1- n) (- n 1)) (define (_1- n) (- n 1))

View File

@ -1,10 +1,10 @@
;;; FIBFP -- Computes fib(35) using floating point ;;; FIBFP -- Computes fib(35) using floating point
(library (r6rs-benchmarks fibfp) (library (rnrs-benchmarks fibfp)
(export main) (export main)
(import (r6rs) (import (rnrs)
(r6rs arithmetic flonums) (rnrs arithmetic flonums)
(r6rs-benchmarks)) (rnrs-benchmarks))
(define (fibfp n) (define (fibfp n)
(if (fl<? n 2.) (if (fl<? n 2.)

View File

@ -1,8 +1,8 @@
;;; FPSUM - Compute sum of integers from 0 to 1e6 using floating point ;;; FPSUM - Compute sum of integers from 0 to 1e6 using floating point
(library (r6rs-benchmarks fpsum) (library (rnrs-benchmarks fpsum)
(export main) (export main)
(import (r6rs) (r6rs arithmetic flonums) (r6rs-benchmarks)) (import (rnrs) (rnrs arithmetic flonums) (rnrs-benchmarks))
(define (run) (define (run)
(let loop ((i 1e6) (n 0.)) (let loop ((i 1e6) (n 0.))

View File

@ -33,9 +33,9 @@
; of free memory. There is no portable way to do this in Scheme; each ; of free memory. There is no portable way to do this in Scheme; each
; implementation needs its own version. ; implementation needs its own version.
(library (r6rs-benchmarks gcbench) (library (rnrs-benchmarks gcbench)
(export main) (export main)
(import (r6rs) (r6rs arithmetic flonums) (r6rs-benchmarks)) (import (rnrs) (rnrs arithmetic flonums) (rnrs-benchmarks))
(define (run-benchmark2 name thunk) (define (run-benchmark2 name thunk)
(display name) (display name)

View File

@ -8,9 +8,9 @@
; Should be good enough for this benchmark. ; Should be good enough for this benchmark.
(library (r6rs-benchmarks gcold) (library (rnrs-benchmarks gcold)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (newRandom) (define (newRandom)
(letrec ((random14 (letrec ((random14

View File

@ -1,8 +1,8 @@
;;; GRAPHS -- Obtained from Andrew Wright. ;;; GRAPHS -- Obtained from Andrew Wright.
(library (r6rs-benchmarks graphs) (library (rnrs-benchmarks graphs)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
;;; ==== util.ss ==== ;;; ==== util.ss ====
@ -59,7 +59,7 @@
((= i len) ((= i len)
state))))) state)))))
; AZIZ: r6rs has vector-map, this is not even used ; AZIZ: rnrs has vector-map, this is not even used
;(define vector-map ;(define vector-map
; (lambda (vec proc) ; (lambda (vec proc)
; (proc->vector (vector-length vec) ; (proc->vector (vector-length vec)

View File

@ -1,8 +1,8 @@
;;; LATTICE -- Obtained from Andrew Wright. ;;; LATTICE -- Obtained from Andrew Wright.
(library (r6rs-benchmarks lattice) (library (rnrs-benchmarks lattice)
(export main) (export main)
(import (r6rs) (r6rs mutable-pairs) (r6rs-benchmarks)) (import (rnrs) (rnrs mutable-pairs) (rnrs-benchmarks))
; Given a comparison routine that returns one of ; Given a comparison routine that returns one of
; less ; less

View File

@ -1,8 +1,8 @@
;;; MATRIX -- Obtained from Andrew Wright. ;;; MATRIX -- Obtained from Andrew Wright.
(library (r6rs-benchmarks matrix) (library (rnrs-benchmarks matrix)
(export main) (export main)
(import (r6rs) (r6rs mutable-pairs) (r6rs-benchmarks)) (import (rnrs) (rnrs mutable-pairs) (rnrs-benchmarks))
; Chez-Scheme compatibility stuff: ; Chez-Scheme compatibility stuff:
(define (chez-box x) (cons x '())) (define (chez-box x) (cons x '()))

View File

@ -10,9 +10,9 @@
;;; Rehacked by Olin 4/1995. ;;; Rehacked by Olin 4/1995.
(library (r6rs-benchmarks maze) (library (rnrs-benchmarks maze)
(export main) (export main)
(import (r6rs) (r6rs mutable-pairs) (r6rs-benchmarks)) (import (rnrs) (rnrs mutable-pairs) (rnrs-benchmarks))
(define (random-state n) (define (random-state n)
(cons n #f)) (cons n #f))

View File

@ -1,9 +1,9 @@
;;; MAZEFUN -- Constructs a maze in a purely functional way, ;;; MAZEFUN -- Constructs a maze in a purely functional way,
;;; written by Marc Feeley. ;;; written by Marc Feeley.
(library (r6rs-benchmarks mazefun) (library (rnrs-benchmarks mazefun)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define foldr (define foldr
(lambda (f base lst) (lambda (f base lst)

View File

@ -1,8 +1,8 @@
;;; MBROT -- Generation of Mandelbrot set fractal. ;;; MBROT -- Generation of Mandelbrot set fractal.
(library (r6rs-benchmarks mbrot) (library (rnrs-benchmarks mbrot)
(export main) (export main)
(import (r6rs) (r6rs arithmetic flonums) (r6rs-benchmarks)) (import (rnrs) (rnrs arithmetic flonums) (rnrs-benchmarks))
(define (count r i step x y) (define (count r i step x y)

View File

@ -4,13 +4,13 @@
; and added nbody-benchmark. ; and added nbody-benchmark.
; 981116 / wdc Replaced nbody-benchmark by main, added apply:+. ; 981116 / wdc Replaced nbody-benchmark by main, added apply:+.
(library (r6rs-benchmarks nbody) (library (rnrs-benchmarks nbody)
(export main) (export main)
(import (import
(r6rs) (rnrs)
(r6rs arithmetic flonums) (rnrs arithmetic flonums)
(r6rs mutable-pairs) (rnrs mutable-pairs)
(r6rs-benchmarks)) (rnrs-benchmarks))
(define void (define void
(let ((invisible (string->symbol ""))) (let ((invisible (string->symbol "")))

View File

@ -54,9 +54,9 @@
; The second phase creates the test problem, and tests to see ; The second phase creates the test problem, and tests to see
; whether it is implied by the lemmas. ; whether it is implied by the lemmas.
(library (r6rs-benchmarks nboyer) (library (rnrs-benchmarks nboyer)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (main . args) (define (main . args)
(let ((n (if (null? args) 0 (car args)))) (let ((n (if (null? args) 0 (car args))))

View File

@ -1,8 +1,8 @@
;;; NQUEENS -- Compute number of solutions to 8-queens problem. ;;; NQUEENS -- Compute number of solutions to 8-queens problem.
(library (r6rs-benchmarks nqueens) (library (rnrs-benchmarks nqueens)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define trace? #f) (define trace? #f)

View File

@ -1,9 +1,9 @@
;;; NTAKL -- The TAKeuchi function using lists as counters, ;;; NTAKL -- The TAKeuchi function using lists as counters,
;;; with an alternative boolean expression. ;;; with an alternative boolean expression.
(library (r6rs-benchmarks ntakl) (library (rnrs-benchmarks ntakl)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (listn n) (define (listn n)
(if (= n 0) (if (= n 0)

View File

@ -18,12 +18,12 @@
; -- MATH UTILITIES ----------------------------------------------------------- ; -- MATH UTILITIES -----------------------------------------------------------
(library (r6rs-benchmarks nucleic) (library (rnrs-benchmarks nucleic)
(export main) (export main)
(import (r6rs) (r6rs arithmetic flonums) (r6rs-benchmarks)) (import (rnrs) (rnrs arithmetic flonums) (rnrs-benchmarks))
(define FLOATatan atan) (define FLOATatan flatan)
(define FLOATcos cos) (define FLOATcos flcos)
(define FLOATsin sin) (define FLOATsin flsin)
(define-syntax nuc-const (define-syntax nuc-const
(syntax-rules () (syntax-rules ()
[(_ x* ...) '#(x* ...)])) [(_ x* ...) '#(x* ...)]))

View File

@ -1,8 +1,8 @@
;;; PARAFFINS -- Compute how many paraffins exist with N carbon atoms. ;;; PARAFFINS -- Compute how many paraffins exist with N carbon atoms.
(library (r6rs-benchmarks paraffins) (library (rnrs-benchmarks paraffins)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (gen n) (define (gen n)
(let* ((n/2 (quotient n 2)) (let* ((n/2 (quotient n 2))

View File

@ -20,9 +20,9 @@
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(library (r6rs-benchmarks parsing) (library (rnrs-benchmarks parsing)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (parsing-benchmark . rest) (define (parsing-benchmark . rest)
(let* ((n (if (null? rest) 1000 (car rest))) (let* ((n (if (null? rest) 1000 (car rest)))

View File

@ -33,9 +33,9 @@
; To: will ; To: will
; Subject: Pancake flips ; Subject: Pancake flips
(library (r6rs-benchmarks perm9) (library (rnrs-benchmarks perm9)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
; Procedure P_n generates a grey code of all perms of n elements ; Procedure P_n generates a grey code of all perms of n elements
; on top of stack ending with reversal of starting sequence ; on top of stack ending with reversal of starting sequence

View File

@ -1,8 +1,8 @@
;;; PEVAL -- A simple partial evaluator for Scheme, written by Marc Feeley. ;;; PEVAL -- A simple partial evaluator for Scheme, written by Marc Feeley.
(library (r6rs-benchmarks peval) (library (rnrs-benchmarks peval)
(export main) (export main)
(import (r6rs) (r6rs mutable-pairs) (r6rs-benchmarks)) (import (rnrs) (rnrs mutable-pairs) (rnrs-benchmarks))
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------

View File

@ -2,9 +2,9 @@
; See http://mathworld.wolfram.com/Pi.html for the various algorithms. ; See http://mathworld.wolfram.com/Pi.html for the various algorithms.
(library (r6rs-benchmarks pi) (library (rnrs-benchmarks pi)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
; Utilities. ; Utilities.

View File

@ -1,8 +1,8 @@
;;; PNPOLY - Test if a point is contained in a 2D polygon. ;;; PNPOLY - Test if a point is contained in a 2D polygon.
(library (r6rs-benchmarks pnpoly) (library (rnrs-benchmarks pnpoly)
(export main) (export main)
(import (r6rs) (r6rs arithmetic flonums) (r6rs-benchmarks)) (import (rnrs) (rnrs arithmetic flonums) (rnrs-benchmarks))
(define (pt-in-poly2 xp yp x y) (define (pt-in-poly2 xp yp x y)
(let loop ((c #f) (i (- (vector-length xp) 1)) (j 0)) (let loop ((c #f) (i (- (vector-length xp) 1)) (j 0))

View File

@ -1,8 +1,8 @@
;;; PRIMES -- Compute primes less than 100, written by Eric Mohr. ;;; PRIMES -- Compute primes less than 100, written by Eric Mohr.
(library (r6rs-benchmarks primes) (library (rnrs-benchmarks primes)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (interval-list m n) (define (interval-list m n)
(if (> m n) (if (> m n)

View File

@ -1,8 +1,8 @@
;;; PUZZLE -- Forest Baskett's Puzzle benchmark, originally written in Pascal. ;;; PUZZLE -- Forest Baskett's Puzzle benchmark, originally written in Pascal.
(library (r6rs-benchmarks puzzle) (library (rnrs-benchmarks puzzle)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (my-iota n) (define (my-iota n)
(do ((n n (- n 1)) (do ((n n (- n 1))

View File

@ -1,9 +1,9 @@
; The quick-1 benchmark. (Figure 35, page 132.) ; The quick-1 benchmark. (Figure 35, page 132.)
(library (r6rs-benchmarks quicksort) (library (rnrs-benchmarks quicksort)
(export main) (export main)
(import (r6rs) (r6rs mutable-pairs) (r6rs-benchmarks)) (import (rnrs) (rnrs mutable-pairs) (rnrs-benchmarks))
(define (quick-1 v less?) (define (quick-1 v less?)

View File

@ -1,9 +1,9 @@
;;; RAY -- Ray-trace a simple scene with spheres, generating a ".pgm" file. ;;; RAY -- Ray-trace a simple scene with spheres, generating a ".pgm" file.
;;; Translated to Scheme from Paul Graham's book ANSI Common Lisp, Example 9.8 ;;; Translated to Scheme from Paul Graham's book ANSI Common Lisp, Example 9.8
(library (r6rs-benchmarks ray) (library (rnrs-benchmarks ray)
(export main) (export main)
(import (r6rs) (r6rs arithmetic flonums) (r6rs-benchmarks)) (import (rnrs) (rnrs arithmetic flonums) (rnrs-benchmarks))
(define (make-point x y z) (define (make-point x y z)
(vector x y z)) (vector x y z))

View File

@ -55,9 +55,9 @@
; The second phase creates the test problem, and tests to see ; The second phase creates the test problem, and tests to see
; whether it is implied by the lemmas. ; whether it is implied by the lemmas.
(library (r6rs-benchmarks sboyer) (library (rnrs-benchmarks sboyer)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (main . args) (define (main . args)
(let ((n (if (null? args) 0 (car args)))) (let ((n (if (null? args) 0 (car args))))

View File

@ -2,9 +2,9 @@
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(library (r6rs-benchmarks scheme) (library (rnrs-benchmarks scheme)
(export main) (export main)
(import (r6rs) (r6rs mutable-pairs) (r6rs-benchmarks)) (import (rnrs) (rnrs mutable-pairs) (rnrs-benchmarks))
(define (scheme-eval expr) (define (scheme-eval expr)
(let ((code (scheme-comp expr scheme-global-environment))) (let ((code (scheme-comp expr scheme-global-environment)))
@ -860,6 +860,46 @@
(scheme-global-var name) (scheme-global-var name)
value)) value))
(define (main . args)
(run-benchmark
"scheme"
scheme-iters
(lambda (result)
(equal? result
'("eight" "eleven" "five" "four" "nine" "one"
"seven" "six" "ten" "three" "twelve" "two")))
(lambda (expr) (lambda () (scheme-eval expr)))
'(let ()
(define (sort-list obj pred)
(define (loop l)
(if (and (pair? l) (pair? (cdr l)))
(split l '() '())
l))
(define (split l one two)
(if (pair? l)
(split (cdr l) two (cons (car l) one))
(merge (loop one) (loop two))))
(define (merge one two)
(cond ((null? one) two)
((pred (car two) (car one))
(cons (car two)
(merge (cdr two) one)))
(else
(cons (car one)
(merge (cdr one) two)))))
(loop obj))
(sort-list '("one" "two" "three" "four" "five" "six"
"seven" "eight" "nine" "ten" "eleven" "twelve")
string<?))))
(def-proc 'not (lambda (x) (not x))) (def-proc 'not (lambda (x) (not x)))
(def-proc 'boolean? boolean?) (def-proc 'boolean? boolean?)
(def-proc 'eqv? eqv?) (def-proc 'eqv? eqv?)
@ -1040,40 +1080,4 @@
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(define (main . args) )
(run-benchmark
"scheme"
scheme-iters
(lambda (result)
(equal? result
'("eight" "eleven" "five" "four" "nine" "one"
"seven" "six" "ten" "three" "twelve" "two")))
(lambda (expr) (lambda () (scheme-eval expr)))
'(let ()
(define (sort-list obj pred)
(define (loop l)
(if (and (pair? l) (pair? (cdr l)))
(split l '() '())
l))
(define (split l one two)
(if (pair? l)
(split (cdr l) two (cons (car l) one))
(merge (loop one) (loop two))))
(define (merge one two)
(cond ((null? one) two)
((pred (car two) (car one))
(cons (car two)
(merge (cdr two) one)))
(else
(cons (car one)
(merge (cdr one) two)))))
(loop obj))
(sort-list '("one" "two" "three" "four" "five" "six"
"seven" "eight" "nine" "ten" "eleven" "twelve")
string<?)))))

View File

@ -1,8 +1,8 @@
;;; SIMPLEX -- Simplex algorithm. ;;; SIMPLEX -- Simplex algorithm.
(library (r6rs-benchmarks simplex) (library (rnrs-benchmarks simplex)
(export main) (export main)
(import (r6rs) (r6rs arithmetic flonums) (r6rs-benchmarks)) (import (rnrs) (rnrs arithmetic flonums) (rnrs-benchmarks))
(define (matrix-rows a) (vector-length a)) (define (matrix-rows a) (vector-length a))
(define (matrix-columns a) (vector-length (vector-ref a 0))) (define (matrix-columns a) (vector-length (vector-ref a 0)))

View File

@ -4,14 +4,14 @@
;This file is compatible for the dialect other ;This file is compatible for the dialect other
;(c) Dorai Sitaram, Rice U., 1991, 1994 ;(c) Dorai Sitaram, Rice U., 1991, 1994
(library (r6rs-benchmarks slatex) (library (rnrs-benchmarks slatex)
(export main) (export main)
(import (import
(r6rs) (rnrs)
(r6rs unicode) (rnrs unicode)
(r6rs mutable-pairs) (rnrs mutable-pairs)
(r6rs i/o simple) (rnrs i/o simple)
(r6rs-benchmarks)) (rnrs-benchmarks))
(define *op-sys* 'unix) (define *op-sys* 'unix)
@ -2345,4 +2345,4 @@
slatex-iters slatex-iters
(lambda (result) #t) (lambda (result) #t)
(lambda (filename) (lambda () (slatex.process-main-tex-file filename))) (lambda (filename) (lambda () (slatex.process-main-tex-file filename)))
"r6rs-benchmarks/slatex-data/test"))) "rnrs-benchmarks/slatex-data/test")))

View File

@ -1,8 +1,8 @@
;;; STRING -- One of the Kernighan and Van Wyk benchmarks. ;;; STRING -- One of the Kernighan and Van Wyk benchmarks.
(library (r6rs-benchmarks string) (library (rnrs-benchmarks string)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define s "abcdef") (define s "abcdef")

View File

@ -1,8 +1,8 @@
;;; SUM -- Compute sum of integers from 0 to 10000 ;;; SUM -- Compute sum of integers from 0 to 10000
(library (r6rs-benchmarks sum) (library (rnrs-benchmarks sum)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (run n) (define (run n)
(let loop ((i n) (sum 0)) (let loop ((i n) (sum 0))

View File

@ -1,8 +1,8 @@
;;; SUM1 -- One of the Kernighan and Van Wyk benchmarks. ;;; SUM1 -- One of the Kernighan and Van Wyk benchmarks.
(library (r6rs-benchmarks sum1) (library (rnrs-benchmarks sum1)
(export main) (export main)
(import (r6rs) (r6rs arithmetic flonums) (r6rs-benchmarks)) (import (rnrs) (rnrs arithmetic flonums) (rnrs-benchmarks))
(define inport #f) (define inport #f)

View File

@ -1,7 +1,7 @@
;;; SUMFP -- Compute sum of integers from 0 to 10000 using floating point ;;; SUMFP -- Compute sum of integers from 0 to 10000 using floating point
(library (r6rs-benchmarks sumfp) (library (rnrs-benchmarks sumfp)
(export main) (export main)
(import (r6rs) (r6rs arithmetic flonums) (r6rs-benchmarks)) (import (rnrs) (rnrs arithmetic flonums) (rnrs-benchmarks))
(define (run n) (define (run n)

View File

@ -1,8 +1,8 @@
;;; SUMLOOP -- One of the Kernighan and Van Wyk benchmarks. ;;; SUMLOOP -- One of the Kernighan and Van Wyk benchmarks.
(library (r6rs-benchmarks sumloop) (library (rnrs-benchmarks sumloop)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define sum 0) (define sum 0)

View File

@ -1,8 +1,8 @@
;;; TAIL -- One of the Kernighan and Van Wyk benchmarks. ;;; TAIL -- One of the Kernighan and Van Wyk benchmarks.
(library (r6rs-benchmarks tail) (library (rnrs-benchmarks tail)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define inport #f) (define inport #f)
(define outport #f) (define outport #f)

View File

@ -1,9 +1,9 @@
;;; TAK -- A vanilla version of the TAKeuchi function. ;;; TAK -- A vanilla version of the TAKeuchi function.
(library (r6rs-benchmarks tak) (library (rnrs-benchmarks tak)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (tak x y z) (define (tak x y z)
(if (not (< y x)) (if (not (< y x))

View File

@ -1,8 +1,8 @@
;;; TAKL -- The TAKeuchi function using lists as counters. ;;; TAKL -- The TAKeuchi function using lists as counters.
(library (r6rs-benchmarks takl) (library (rnrs-benchmarks takl)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define (listn n) (define (listn n)
(if (= n 0) (if (= n 0)

View File

@ -1,8 +1,8 @@
;;; TRAV1 -- Benchmark which creates and traverses a tree structure. ;;; TRAV1 -- Benchmark which creates and traverses a tree structure.
(library (r6rs-benchmarks trav1) (library (rnrs-benchmarks trav1)
(export main) (export main)
(import (r6rs) (r6rs mutable-pairs) (r6rs-benchmarks)) (import (rnrs) (rnrs mutable-pairs) (rnrs-benchmarks))
(define (make-node) (define (make-node)
(vector 'node '() '() (snb) #f #f #f #f #f #f #f)) (vector 'node '() '() (snb) #f #f #f #f #f #f #f))

View File

@ -1,8 +1,8 @@
;;; TRAV2 -- Benchmark which creates and traverses a tree structure. ;;; TRAV2 -- Benchmark which creates and traverses a tree structure.
(library (r6rs-benchmarks trav2) (library (rnrs-benchmarks trav2)
(export main) (export main)
(import (r6rs) (r6rs mutable-pairs) (r6rs-benchmarks)) (import (rnrs) (rnrs mutable-pairs) (rnrs-benchmarks))
(define (make-node) (define (make-node)
(vector 'node '() '() (snb) #f #f #f #f #f #f #f)) (vector 'node '() '() (snb) #f #f #f #f #f #f #f))

View File

@ -1,8 +1,8 @@
;;; TRIANGL -- Board game benchmark. ;;; TRIANGL -- Board game benchmark.
(library (r6rs-benchmarks triangl) (library (rnrs-benchmarks triangl)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define *board* (define *board*
(list->vector '(1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1))) (list->vector '(1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1)))

View File

@ -1,8 +1,8 @@
;;; WC -- One of the Kernighan and Van Wyk benchmarks. ;;; WC -- One of the Kernighan and Van Wyk benchmarks.
(library (r6rs-benchmarks wc) (library (rnrs-benchmarks wc)
(export main) (export main)
(import (r6rs) (r6rs-benchmarks)) (import (rnrs) (rnrs-benchmarks))
(define inport #f) (define inport #f)