summaryrefslogtreecommitdiff
path: root/bench/bigfactorial.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-09-04 02:58:44 -0700
committerOri Bernstein <ori@eigenstate.org>2017-09-04 02:58:54 -0700
commit7ef09f3db883c42d01e3b1d80f0d2da6ceff9913 (patch)
treeaf370bd4f281a680b9793034f3b5baee1aa43471 /bench/bigfactorial.myr
parent40d6f7b5cc0cb9e5de1675a1441ad0dfc0a66bda (diff)
downloadmc-7ef09f3db883c42d01e3b1d80f0d2da6ceff9913.tar.gz
Modernize benchmarks.
Diffstat (limited to 'bench/bigfactorial.myr')
-rw-r--r--bench/bigfactorial.myr12
1 files changed, 7 insertions, 5 deletions
diff --git a/bench/bigfactorial.myr b/bench/bigfactorial.myr
index 4363774..cbaab6c 100644
--- a/bench/bigfactorial.myr
+++ b/bench/bigfactorial.myr
@@ -1,11 +1,13 @@
use std
+use testr
-const N = 600
const main = {
- var i
- for i = 0; i < N; i++
- std.bigfree(bigfact(i))
- ;;
+ testr.bench([
+ [.name="bigfactorial-1", .fn={ctx; bigfact(1)}],
+ [.name="bigfactorial-100", .fn={ctx; bigfact(100)}],
+ [.name="bigfactorial-1000", .fn={ctx; bigfact(1000)}],
+ [.name="bigfactorial-10000", .fn={ctx; bigfact(10000)}],
+ ][:])
}
const bigfact = {n