Re: Adding assembler code to Lua programs

  • From: Konstantin Olkhovskiy <lupus@xxxxxxxxxx>
  • To: luajit <luajit@xxxxxxxxxxxxx>
  • Date: Sat, 8 Mar 2014 11:34:46 +0400

2014-03-08 3:17 GMT+04:00 Jiale Zhi <vipcalio@xxxxxxxxx>:
>
> Speaking of serialization, I think Cap'n Proto is a very good project
> to look at. http://kentonv.github.io/capnproto/. No CPU waste to save a
> couple of bytes.
>

It looks interesting, thanks for the link Jiale!
But you state on your Lua repo that it's not production ready.
Also I could not find proper C implementation.

We've chosen MessagePack as it has plenty of implementations and C
implementation
they provide is production ready. Also there is a LuaJIT implementation
with FFI [1], which
works way faster than pure Lua one [2] because the former gets fully JIT
compiled (once
we've dropped maps and claimed all tables to be arrays).

The idea we think of so far to improve the situation is to index offsets of
fields within the
encoded object. As we know that it's pretty small, two bytes should be
enough for one
offset.

Hopefully that should improve the situation with branches, one jump to an
object of
interest, and since we have an explicit schema, we know what type is that
object.

[1] https://github.com/catwell/luajit-msgpack-pure
[2] https://github.com/fperrad/lua-MessagePack

-- 
Regards,
Konstantin

Other related posts: