feat: add benchmark runner with fib implementations and OS.clock primitive

Add a benchmark runner script (benchmark/run_all) that executes multiple
fibonacci implementations across languages (Lua, Python, Ruby, Wren) and
computes mean, median, and standard deviation from 7 runs. Update existing
fib benchmarks to loop 5 times at fib(30) with elapsed timing. Introduce
OS.clock primitive in C core and OS class to support timing in Wren.
Adjust number formatting to "%.14g" for consistent output precision.
This commit is contained in:
Bob Nystrom
2013-11-22 16:55:22 +00:00
parent 4a9ea2f0b4
commit 95faef89d5
7 changed files with 112 additions and 7 deletions
+7 -1
View File
@@ -6,4 +6,10 @@ var fib = fn(n) {
}
}
io.write(fib.call(35))
var start = OS.clock
var i = 0
while (i < 5) {
io.write(fib.call(30))
i = i + 1
}
io.write("elapsed: " + (OS.clock - start).toString)