lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



2014-08-20 15:05 GMT+08:00 Javier Guerra Giraldez <javier@guerrag.com>:
On Wed, Aug 20, 2014 at 1:25 AM, 云风 <cloudwu@gmail.com> wrote:
> sproto is an efficient serialization library for C, and focus on lua
> binding. It's like google protocol buffers, but much faster.


i found it surprising that lua-cjson is significantly faster than
pbc-lua.  any theories about why?

json has no schema . Translate the tags need more time. and protocol buffer has default value for each field, 
pbc-lua need binding a metatable for each object. 

Encoding/decoding varint is more complex, and each protobuffer object need a varint for the length. the size of varint is not fixed. 
so encoding complex message need more memcpy or memmove.

--
http://blog.codingnow.com