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:
+7
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user