Hi, Sergey,
thanks for the patch! See comments below.
Sergey
This patch adjusts the aforementioned test to use the benchmark
framework introduced before. The default arguments are adjusted
according to the <PARAM_x86.txt> file. The arguments to the script still
can be provided in the command line run.
---
perf/LuaJIT-benches/series.lua | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/perf/LuaJIT-benches/series.lua b/perf/LuaJIT-benches/series.lua
index f766cb32..3dc970c5 100644
--- a/perf/LuaJIT-benches/series.lua
+++ b/perf/LuaJIT-benches/series.lua
@@ -1,3 +1,4 @@
+local bench = require("bench").new(arg)
local function integrate(x0, x1, nsteps, omegan, f)
local x, dx = x0, (x1-x0)/nsteps
@@ -26,9 +27,16 @@ local function series(n)
end
local n = tonumber(arg and arg[1]) or 10000
-local tm = os.clock()
-local t = series(n)
-tm = os.clock() - tm
-assert(math.abs(t[1]-2.87295) < 0.00001)
-io.write(string.format("size %d, %.2f s, %.1f iterations/s\n",
- n, tm, (2*n-1)/tm))
debug print was lost, is it intentional?
+
+bench:add({
+ name = "series",
+ checker = function(res)
+ return math.abs(res[1]-2.87295) < 0.00001
add more whitespaces
+ end, + payload = function() + return series(n) + end, + items = 2 * n - 1, +}) + +bench:run_and_report()