From 8cd99e6a2e86ff510608655be60e30ac7460e147 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Wed, 13 Jun 2007 10:19:16 +0300 Subject: [PATCH] * Added ackerman benchmark --- benchmarks/new/r6rs-benchmarks.ss | 4 +++- benchmarks/new/r6rs-benchmarks/ack.ss | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 benchmarks/new/r6rs-benchmarks/ack.ss diff --git a/benchmarks/new/r6rs-benchmarks.ss b/benchmarks/new/r6rs-benchmarks.ss index 440cbed..b120d9c 100644 --- a/benchmarks/new/r6rs-benchmarks.ss +++ b/benchmarks/new/r6rs-benchmarks.ss @@ -1,6 +1,8 @@ (library (r6rs-benchmarks) - (export run-benchmark fib-iters) + (export run-benchmark + ack-iters + fib-iters) (import (ikarus)) (define (run-bench count run) diff --git a/benchmarks/new/r6rs-benchmarks/ack.ss b/benchmarks/new/r6rs-benchmarks/ack.ss new file mode 100644 index 0000000..92eadf4 --- /dev/null +++ b/benchmarks/new/r6rs-benchmarks/ack.ss @@ -0,0 +1,19 @@ +;;; ACK -- One of the Kernighan and Van Wyk benchmarks. + +(library (r6rs-benchmarks ack) + (export main) + (import (r6rs) (r6rs-benchmarks)) + + (define (ack m n) + (cond ((= m 0) (+ n 1)) + ((= n 0) (ack (- m 1) 1)) + (else (ack (- m 1) (ack m (- n 1)))))) + + (define (main . args) + (run-benchmark + "ack" + ack-iters + (lambda (result) (equal? result 4093)) + (lambda (m n) (lambda () (ack m n))) + 3 + 9)))