mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-04 01:25:04 +03:00
A script for running all benchmarks.
This commit is contained in:
parent
4034d02183
commit
2759fe9498
@ -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
13
benchmarks.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user