mirror of
https://github.com/TangentFoxy/rxi-json.lua.git
synced 2025-07-27 18:42:17 +00:00
Added warmup for JIT in benchmark scripts
This commit is contained in:
@@ -62,6 +62,9 @@ for i, name in ipairs(libs) do
|
||||
json.decode = function(...) return _decode(json, ...) end
|
||||
end
|
||||
|
||||
-- Warmup (for LuaJIT)
|
||||
bench.run(name, 1, function() json.decode(text) end)
|
||||
|
||||
-- Run and push results
|
||||
local res = bench.run(name, 10, function() json.decode(text) end)
|
||||
table.insert(results, res)
|
||||
|
@@ -50,6 +50,9 @@ for i, name in ipairs(libs) do
|
||||
json.decode = function(...) return _decode(json, ...) end
|
||||
end
|
||||
|
||||
-- Warmup (for LuaJIT)
|
||||
bench.run(name, 1, function() json.encode(data) end)
|
||||
|
||||
-- Run and push results
|
||||
local res = bench.run(name, 10, function() json.encode(data) end)
|
||||
table.insert(results, res)
|
||||
|
Reference in New Issue
Block a user