2 Some Time Trails for the JSON4Lua package
6 local os
= require('os')
7 local table = require('table')
8 local string = require("string")
10 local skipDecode
= (...) == '--skipDecode'
11 local count
= tonumber(select(2, ...) or 500) or 500
12 local strDup
= tonumber(select(3, ...) or 1) or 1
22 t
[#t
+ 1] = string.rep("VALUE", strDup
)
25 if not skipDecode
then v
= json
.decode(jstr
) end
26 --print(json.encode(t))
33 local idx
= string.rep('a'..j
, strDup
)
37 t
[idx
] = json
.util
.null
41 t
[idx
] = string.char(j
% 0xFF)
45 if not skipDecode
then v
= json
.decode(jstr
) end
52 print ("Elapsed time=" .. os
.difftime(t2
,t1
) .. "s")