summaryrefslogtreecommitdiff
path: root/bench/intsort.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-08-15 15:13:44 -0400
committerOri Bernstein <ori@eigenstate.org>2014-08-15 15:13:44 -0400
commit437f6d851e88446fba90495a3175f02e8d3d390c (patch)
tree3bcb1e2b9c9e48e7547570b374c110faef8712d5 /bench/intsort.myr
parenta5a4e162cec3bb59c7d88a703d45edc916392453 (diff)
downloadmc-437f6d851e88446fba90495a3175f02e8d3d390c.tar.gz
Add benchmarking runner and makefile.
Now you can do 'make bench', and see how fast Myrddin runs. Or at least the integer sorting bit. TODO: expand this so that you can see how it compares to previous results, and add benchmarks.
Diffstat (limited to 'bench/intsort.myr')
-rw-r--r--bench/intsort.myr6
1 files changed, 1 insertions, 5 deletions
diff --git a/bench/intsort.myr b/bench/intsort.myr
index d8c3227..008e6ba 100644
--- a/bench/intsort.myr
+++ b/bench/intsort.myr
@@ -4,15 +4,11 @@ const main = {
var a
var i
var rng
- var t0, t1
rng = std.mksrng(123)
- a = std.slalloc(1000000)
+ a = std.slalloc(100_000)
for i = 0; i < a.len; i++
a[i] = std.rand32(rng)
;;
- t0 = std.now()
std.sort(a, std.numcmp)
- t1 = std.now()
- std.put("time = %l\n", t1 - t0)
}