New test result:
On windows:
This json module performance a bit slower than cjson when processing booleans nulls strings. but much faster than cjson when processing numbers.
On Linux (tested on Travis).
This json only module only a bit faster when encoding numbers.
"Ordered keys" means when this module encoding lua table as object.
Keys are sorted. But this is not true for the current developing version.
A `option.sort_keys` has added and default to false.
"detect for table types"
This json module support meta table field __jsontype to specify `"array"` or `"object"` types.
On Tue, Mar 31, 2015 at 10:55 PM Nagaev Boris <
bnagaev@gmail.com> wrote:
On Tue, Mar 31, 2015 at 2:21 AM, Xpol Wan <xpolife@gmail.com> wrote:
> I have just add a simple test on Windows 7 with LuaJIT 2.0.3:
>
> It seem:
>
> * json is faster when decoding (especially large data)
> * cjson is faster when encoding data
>
> but json have more feature when encoding (ordered keys, and try to do best
> detect for table types).
>
> I'll add performance test in travis and appveyor later.
>
> Detailed test result:
>
> [rapidjson/bin/data/sample.json][1]:
> json.decode() 1.3516025543213
> cjson.decode() 2.2664051055908
> json.encode() 2.2368049621582
> cjson.encode() 1.3914031982422
>
> [rapidjson/bin/data/webapp.json][2]:
> json.decode() 2.4480056762695
> cjson.decode() 2.6756038665771
> json.encode() 2.6312065124512
> cjson.encode() 2.0330047607422
>
>
> [1]:https://github.com/xpol/json/blob/master/rapidjson/bin/data/sample.json
> [2]:https://github.com/xpol/json/blob/master/rapidjson/bin/data/webapp.json
>
>
Can you provide more details on "ordered keys, and try to do best
detect for table types". I think, order of keys does not matter either
for JSON objects or for Lua tables. What are table types detected by
json module?
Can you include cjon's encoding part into json?
Best regards,
Boris Nagaev