Skip to content

Commit

Permalink
Preparations for new run.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter committed Jul 3, 2024
1 parent 1d438da commit 6dacff8
Show file tree
Hide file tree
Showing 17 changed files with 68 additions and 116 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: csv clean all

doc:
echo Run make all to run all tests
@echo Run "'make all'" to run all tests
csv: all.csv

all.csv: $(wildcard results.*)
Expand Down
20 changes: 14 additions & 6 deletions Makefile.schemes
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
all: results.Bigloo results.Bones results.Chez results.Chibi results.Chicken results.ChickenCSI results.GambitC results.Gauche results.Guile results.Loko results.MIT results.Petite results.Racket results.S7 results.S9fES results.Cyclone results.Owl-Lisp results.Stalin results.Ypsilon results.Mosh results.Picrin results.TR7
# results.Foment results.IronScheme results.Sagittarius results.Scheme48 results.Femtolisp results.Kawa results.TinyScheme
# results.Gerbil results.SISC results.Vicare results.RScheme results.Larceny results.Rhizome
all: results.Bigloo results.Bones results.Chez results.Chibi results.Chicken results.ChickenCSI results.Cyclone results.Femtolisp results.GambitC results.Gauche results.Guile results.IronScheme results.Kawa results.Larceny results.Loko results.MIT results.Mosh results.Petite-Chez results.Picrin results.Racket results.S7 results.S9fES results.Sagittarius results.Stalin results.TinyScheme results.TR7 results.Ypsilon

## not sure this can be made to work, it doesn't have read, begin, ...
# results.Owl-Lisp
## not packaged
# results.Foment
## does not build correctly
# results.Scheme48
# results.Gerbil results.SISC results.Vicare results.RScheme results.Rhizome
## missing
# stklos

results.TR7:
./bench tr7 all
Expand Down Expand Up @@ -74,8 +82,8 @@ results.Mosh:
results.Owl-Lisp:
./bench owllisp all

results.Petite:
./bench petite all
results.Petite-Chez:
./bench petite-chez all

results.Picrin:
./bench picrin all
Expand Down Expand Up @@ -141,7 +149,7 @@ mit: results.MIT

mosh: results.Mosh

petite: results.Petite
petite-chez: results.Petite-Chez

picrin: results.Picrin

Expand Down
40 changes: 21 additions & 19 deletions bench
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ SYNTH_BENCHMARKS="equal bv2string"

ALL_BENCHMARKS="$GABRIEL_BENCHMARKS $NUM_BENCHMARKS $KVW_BENCHMARKS $IO_BENCHMARKS $OTHER_BENCHMARKS $GC_BENCHMARKS $SYNTH_BENCHMARKS"

ALL_SYSTEMS="bigloo bones chez chibi chicken chickencsi cyclone femtolisp foment gambitc gauche gerbil guile ironscheme kawa larceny loko mit owllisp petite picrin racket rhizome rscheme s7 s9fes sagittarius scheme48 stklos tr7 vicare ypsilon"
ALL_SYSTEMS="bigloo bones chez chibi chicken chickencsi cyclone femtolisp gambitc gauche guile ironscheme kawa larceny loko mit mosh petite-chez picrin racket s7 s9fes sagittarius tinyscheme tr7 ypsilon" # foment gerbil owllisp rhizome rscheme scheme48 stklos vicare
# tinyscheme has no way to keep time, so there's no way to *measure* runtime...
################################################################

NB_RUNS=1
Expand Down Expand Up @@ -131,7 +132,7 @@ setup ()
MOSH=${MOSH:-"mosh-scheme"}
OL=${OL:-"ol"}
PETIT=${PETIT:-"../../../../PetitGit/larceny"}
PETITE=${PETITE:-"petite"}
PETITE_CHEZ=${PETITE_CHEZ:-"petite"}
PICRIN=${PICRIN:-"picrin"}
RACKET=${RACKET:-"racket"}
RACKET_RACO=${RACKET_RACO:-"raco"}
Expand Down Expand Up @@ -185,7 +186,7 @@ Usage: bench [-r runs] <system> <benchmark>
mosh for Mosh
owllisp for Owl-Lisp
petit for Petit Larceny
petite for Petite Chez
petite-chez for Petite Chez
picrin for Picrin
racket for Racket
rhizome for Rhizome
Expand Down Expand Up @@ -683,16 +684,16 @@ chez_exec ()
# -----------------------------------------------------------------------------
# Definitions specific to Petite Chez

petite_comp ()
petite_chez_comp ()
{
:
}

petite_exec ()
petite_chez_exec ()
{
# remove import statement
sed -i -e 's/^(import (scheme.*)$//g' $1
time "${PETITE}" --program "$1" < "$2"
time "${PETITE_CHEZ}" --program "$1" < "$2"
}

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -784,7 +785,7 @@ gauche_exec ()
gerbil_comp ()
{
sed -i -e 's/^(run-benchmark)$//' $1
${GERBIL} -d $(dirname "$1") -exe -O -prelude "(declare (not safe))" -o "${1%.scm}.exe" "$1"
${GERBIL} -d $(dirname "$1") -exe -O -o "${1%.scm}.exe" "$1"
}

gerbil_exec ()
Expand All @@ -798,9 +799,9 @@ gerbil_exec ()

# I could not get huskc to work:
#
# % ./huskc /tmp/larcenous/fib.scm
# % ./huskc /tmp/r7rs-benchmarks/fib.scm
#
# /tmp/larcenous/fib.hs:14:8:
# /tmp/r7rs-benchmarks/fib.hs:14:8:
# Could not find module `Language.Scheme.Variables'
# Use -v to see a list of the files searched for.

Expand Down Expand Up @@ -839,6 +840,7 @@ mosh_comp ()

mosh_exec ()
{
sed -i 's/(scheme time)/(only (scheme time) current-jiffy current-second)/' "$1"
time "${MOSH}" "$1" < "$2"
}

Expand Down Expand Up @@ -1182,15 +1184,15 @@ for system in $systems ; do
EXECCOMMANDS=""
;;

petite) NAME='Petite'
COMP=petite_comp
EXEC=petite_exec
COMPOPTS=""
EXTENSION="scm"
EXTENSIONCOMP="scm"
COMPCOMMANDS=""
EXECCOMMANDS=""
;;
petite-chez) NAME='Petite-Chez'
COMP=petite_chez_comp
EXEC=petite_chez_exec
COMPOPTS=""
EXTENSION="scm"
EXTENSIONCOMP="scm"
COMPCOMMANDS=""
EXECCOMMANDS=""
;;

gambitc) NAME='GambitC'
COMP=gambitc_comp
Expand Down Expand Up @@ -1342,7 +1344,7 @@ for system in $systems ; do
echo '****************************'
echo Benchmarking ${NAME} on `date` under `uname -a`
} >> results.${NAME}
TEMP="/tmp/larcenous/${NAME}"
TEMP="/tmp/r7rs-benchmarks/${NAME}"
mkdir -p "${TEMP}" 2> /dev/null

for program in $benchmarks ; do
Expand Down
2 changes: 1 addition & 1 deletion src/Chez-postlude.scm
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
(number->string b)
"."
(number->string c))))
"-" threads bits)))
"-" threads bits "+r7rs")))
2 changes: 1 addition & 1 deletion src/Chicken-prelude.scm
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
(import (only (chicken platform) chicken-version))
(define (this-scheme-implementation-name) (string-append "chicken5-" (chicken-version)))
(define (this-scheme-implementation-name) (string-append "chicken-" (chicken-version)))
2 changes: 1 addition & 1 deletion src/ChickenCSI-prelude.scm
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
(import (only (chicken platform) chicken-version))
(define (this-scheme-implementation-name) (string-append "chicken5csi-" (chicken-version)))
(define (this-scheme-implementation-name) (string-append "chickencsi-" (chicken-version)))
2 changes: 2 additions & 0 deletions src/Gerbil-postlude.scm
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
(string-append (car parts) "-" (cadr parts))
(car parts))))
(string-append "gerbil-" version)))
(define (main)
(run-benchmark))
1 change: 1 addition & 0 deletions src/Gerbil-prelude.scm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
prelude: :scheme/r7rs
;; (declare (not safe)) ;; do not use unsafe optimizations
(export main)

2 changes: 2 additions & 0 deletions src/Mosh-prelude.scm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
(import (mosh config))
(define (this-scheme-implementation-name)
(string-append "mosh-" (get-config "version")))
(define (jiffies-per-second)
1)
21 changes: 0 additions & 21 deletions src/Petite-postlude.scm

This file was deleted.

54 changes: 0 additions & 54 deletions src/Petite-prelude.scm

This file was deleted.

2 changes: 1 addition & 1 deletion src/Picrin-postlude.scm
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(define (this-scheme-implementation-name) (string-append "picrin-" "unknown"))
(define (this-scheme-implementation-name) (string-append "picrin-" "unknown~0.4"))
6 changes: 3 additions & 3 deletions src/S7-prelude.scm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;;;; kindly provided by mgubi (https://github.com/ecraven/r7rs-benchmarks/issues/55)
(define (this-scheme-implementation-name) "s7")
(define (this-scheme-implementation-name) (string-append "s7-" (number->string (*s7* 'major-version)) "." (number->string (*s7* 'minor-version))))
(define exact-integer? integer?)
(define (exact-integer-sqrt i) (let ((sq (floor (sqrt i)))) (values sq (- i (* sq sq)))))
(define inexact exact->inexact)
Expand Down Expand Up @@ -63,8 +63,8 @@
(define (,? ,obj)
(and (let? ,obj)
(eq? (let-ref ,obj 'type) ',type)))
(define ,make

(define ,make
(inlet 'type ',type ,@args))

,@(map
Expand Down
2 changes: 1 addition & 1 deletion src/TR7-prelude.scm
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(define (this-scheme-implementation-name) "tr7")
(define (this-scheme-implementation-name) "tr7-unknown")
17 changes: 14 additions & 3 deletions src/TinyScheme-prelude.scm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
(define (jiffies-per-second) 1)
(define (current-jiffy) 0)
(define (current-second) 0)
(define (call-with-values thunk receiver)
(let ((values (thunk)))
(apply receiver values)))
Expand All @@ -13,3 +10,17 @@
(define (flush-output-port x) x)
(define inexact exact->inexact)
(define exact inexact->exact)
(define (exact-integer? n) (and (exact? n) (integer? n)))
;; TinyScheme has no way to tell time, so read /proc/uptime. Because there are two functions,
;; current-jiffy and current-second, we have to *cache* the time. We rely on the fact that
;; current-jiffy is only ever called *after* current-second has been called before :-/
(define *current-jiffy* 0)
(define (jiffies-per-second) 100)
(define (current-second)
(let ((ut (uptime)))
(set! *current-jiffy* (inexact->exact (truncate (* ut 100))))
(inexact->exact (truncate ut))))
(define (current-jiffy)
*current-jiffy*)
(define (uptime)
(with-input-from-file "/proc/uptime" read))
5 changes: 3 additions & 2 deletions src/Ypsilon-prelude.scm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(import (rnrs) (rnrs mutable-pairs) (rnrs mutable-strings) (rnrs io simple) (srfi :19) (rnrs r5rs (6)))
(import (rnrs) (rnrs mutable-pairs) (rnrs mutable-strings) (rnrs io simple) (srfi :19) (rnrs r5rs (6)) (rnrs io ports))
(define (current-second)
(let ((d (current-date)))
(+ (* 60 60 (date-hour d))
Expand All @@ -9,4 +9,5 @@
(define (jiffies-per-second)
1)
(define (this-scheme-implementation-name)
(string-append "ypsilon-" "unknown"))
(string-append "ypsilon-" "unknown~0.9.6"))
(define (exact-integer? n) (and (exact? n) (integer? n)))
4 changes: 2 additions & 2 deletions src/common.scm
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
(cond ((< i count)
(loop (+ i 1) (thunk)))
((ok? result)
(let* ((j1 (current-jiffy))
(t1 (current-second))
(let* ((t1 (current-second))
(j1 (current-jiffy))
(jifs (- j1 j0))
(secs (inexact (/ jifs j/s)))
(secs2 (rounded (- t1 t0))))
Expand Down

0 comments on commit 6dacff8

Please sign in to comment.