shithub: mc

Download patch

ref: 3cc27c015d4354faed21058af35cf7e4a79839dd
parent: 6ae936b5ec488d9a555afdc2943654b31ff079ab
author: Ori Bernstein <[email protected]>
date: Tue Jun 10 06:48:08 EDT 2014

Add first benchmark: integer sorting.

    TODO: Figure out how to acutally run it automatically.

--- /dev/null
+++ b/bench/intsort.myr
@@ -1,0 +1,18 @@
+use std
+
+const main = {
+    var a
+    var i
+    var rng
+    var t0, t1
+
+    rng = std.mksrng(123)
+    a = std.slalloc(1000000)
+    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)
+}