commit d15e366930d42f2138d99dcc6b0b53aacbddcf8d from: Sergey Bronnikov date: Mon Aug 05 19:47:58 2024 UTC perf/lua: implement iterations in benchmark.lua [WIP] NO_CHANGELOG=perf NO_DOC=perf NO_TEST=perf commit - d48a76b41aa6f4994734a042cd4b007d4dcecc00 commit + d15e366930d42f2138d99dcc6b0b53aacbddcf8d blob - 99539a073dc40ace666993878564bfdd58c9c084 blob + 8c1e52b1d03cdd82f0f2d0cf3a7cf3cf308684ad --- perf/lua/benchmark.lua +++ perf/lua/benchmark.lua @@ -72,7 +72,7 @@ local function dump_report(bench, text) end end -local function add_result(bench, name, data) +local function add_result(bench, name, data, i) local items_per_second = math.floor(data.items / data.real_time) local result = { name = name, @@ -81,6 +81,8 @@ local function add_result(bench, name, data) iterations = data.items, items_per_second = items_per_second, run_name = name, + family_index = i, + per_family_instance_index = 0, run_type = 'iteration', repetitions = 1, repetition_index = 1, blob - 51ecbfd53704e29eb207f5cea7d8a37694562a18 blob + 7344b362eda261cdb74a64988f81cd6e44eb3dbd --- perf/lua/uri_escape_unescape.lua +++ perf/lua/uri_escape_unescape.lua @@ -54,7 +54,7 @@ local tests = {{ end, }} -local function run_test(testname, func) +local function run_test(testname, func, i) local real_time = clock.time() local cpu_time = clock.proc() func() @@ -64,11 +64,11 @@ local function run_test(testname, func) real_time = real_delta, cpu_time = cpu_delta, items = CYCLES, - }) + }, i) end -for _, test in ipairs(tests) do - run_test(test.name, test.payload) +for i, test in ipairs(tests) do + run_test(test.name, test.payload, i - 1) end bench:dump_results()