mirror of
https://github.com/gvx/bitser.git
synced 2024-11-24 06:54:20 +00:00
Bug fix: actually make different tries in benchmark useful
This commit is contained in:
parent
348511c702
commit
eb4c65ffcf
6
main.lua
6
main.lua
@ -106,11 +106,14 @@ function love.draw()
|
|||||||
resultname = "serialisation time in seconds"
|
resultname = "serialisation time in seconds"
|
||||||
results_size = {}
|
results_size = {}
|
||||||
results_deser = {}
|
results_deser = {}
|
||||||
|
for sername, serializer in pairs(sers) do
|
||||||
|
results_ser[sername] = math.huge
|
||||||
|
results_deser[sername] = math.huge
|
||||||
|
end
|
||||||
local outputs = {}
|
local outputs = {}
|
||||||
for try = 1, tries do
|
for try = 1, tries do
|
||||||
for sername, serializer in pairs(sers) do
|
for sername, serializer in pairs(sers) do
|
||||||
local output
|
local output
|
||||||
results_ser[sername] = math.huge
|
|
||||||
local t = os.clock()
|
local t = os.clock()
|
||||||
for i = 1, iters do
|
for i = 1, iters do
|
||||||
output = serializer(data)
|
output = serializer(data)
|
||||||
@ -129,7 +132,6 @@ function love.draw()
|
|||||||
for try = 1, tries do
|
for try = 1, tries do
|
||||||
for sername, deserializer in pairs(desers) do
|
for sername, deserializer in pairs(desers) do
|
||||||
local input = outputs[sername]
|
local input = outputs[sername]
|
||||||
results_deser[sername] = math.huge
|
|
||||||
local t = os.clock()
|
local t = os.clock()
|
||||||
for i = 1, iters / 10 do
|
for i = 1, iters / 10 do
|
||||||
deserializer(input)
|
deserializer(input)
|
||||||
|
Loading…
Reference in New Issue
Block a user