~ chicken-core (master) /tests/runbench.sh
Trap1#!/bin/sh
2# runbench.sh - run benchmarks
3#
4# - Note: this needs a proper shell, so it will not work with plain mingw
5# (just the compiler and the Windows shell, without MSYS)
6
7set -e
8TEST_DIR=`pwd`
9export DYLD_LIBRARY_PATH=${TEST_DIR}/..
10export LD_LIBRARY_PATH=${TEST_DIR}/..
11
12echo
13
14CHICKEN=../chicken
15COMPILE_OPTIONS="-O5 -d0 -disable-interrupts -b"
16
17if test -n "$MSYSTEM"; then
18 CHICKEN="..\\chicken.exe"
19 # make compiled tests use proper library on Windows
20 cp ../lib*chicken*.dll .
21fi
22
23case `uname -s` in
24 *BSD*|*bsd*) timeopts="-c";;
25 Darwin) timeopts="";;
26 *) timeopts='-f "%E elapsed, %U user, %S system"'
27esac
28
29run()
30{
31 /usr/bin/time "$timeopts" ./a.out "$1" "$2" "$3"
32}
33
34echo "****************************************"
35
36compiler_options="-C -Wa,-W"
37compile="../csc -w -compiler $CHICKEN -I.. -L.. -include-path .. -o a.out $COMPILE_OPTIONS"
38interpret="../csi -n -include-path .."
39
40echo "======================================== null ... "
41$compile null.scm -O5
42run -:Hd
43
44echo "======================================== compilation ... "
45/usr/bin/time "$timeopts" $compile compiler.scm
46
47echo "======================================== compiler ... "
48run -:Hd
49
50echo "======================================== slatex ... "
51$compile slatex.scm
52mkdir -p slatexdir
53rm -f slatexdir/*
54run
55
56echo "======================================== grep ... "
57$compile sgrep.scm
58run compiler.scm
59
60echo "======================================== fft/boxed ... "
61$compile fft.scm
62run 2000 11
63echo "======================================== fft/unboxed ... "
64$compile fft.scm -D unboxed
65run 2000 11
66
67echo "======================================== allocation ... "
68$compile gobble.scm
69run 1000000000
70
71echo "======================================== irregex ... "
72/usr/bin/time "$timeopts" $interpret -bnq test-irregex.scm >/dev/null