A script for running all benchmarks.

This commit is contained in:
Erik Svedäng 2018-02-06 09:02:46 +01:00
parent 4034d02183
commit 2759fe9498
2 changed files with 15 additions and 2 deletions

View File

@ -6,7 +6,7 @@
(def p (Point.init 0 0))
(defn creation [] (Point.init 0 0))
(defn access [] (Point.x &p))
(defn bench-access [] (ignore (Point.x &p))) ;; The name 'access' collides with an existing C-function.
(defn set [] (Point.set-x @&p 5))
(defn update [] (Point.update-x @&p Int.inc))
@ -15,7 +15,7 @@
(IO.println "Struct creation:")
(bench creation)
(IO.println "\nStruct access:")
(bench access)
(bench bench-access)
(IO.println "\nUpdate lens:")
(bench update)
(IO.println "\nSetter lens:")

13
benchmarks.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
set -e; # will make the script stop if there are any errors
stack build;
stack install;
# Actual tests (using the test suite)
for f in ./bench/*.carp; do
echo $f
carp -x --optimize $f
echo
done