2010/4/2 Stefan <stefan@chehalispost.com>:
Perhaps a benchmark is in order?
YAJL is reportedly among the fastest C JSON libs around. There is a Lua
module for it here:
http://github.com/brimworks/lua-yajl/
A trivial bench between lua-yajl and json4lua encoding a small array 100,000
times shows this:
alpha# time lua-5.1 yajltest.lua
3.967u 0.000s 0:03.97 99.7% 177+983k 0+0io 0pf+0w
alpha# time lua-5.1 jsontest.lua
9.170u 0.000s 0:09.17 100.0% 175+973k 0+0io 0pf+0w
230% faster is what I am seeing - YMMV
Thanks for the tip. lua-yajl decoding seems to be about 18% faster
than luajson, and encoding is 400% faster. But it seems to be a work
in progress, and it's less complete than luajson, so I guess I won't
switch just now.