why creating a ffi.ctype "double [1]" is slow?

  • From: Ruoshan Huang <ruoshan.huang@xxxxxxxxx>
  • To: LuaJIT <luajit@xxxxxxxxxxxxx>
  • Date: Tue, 22 Apr 2014 15:46:10 +0800

hi there,
    I have this performance issue about packing a double into raw string and 
unpacking in it.
here is the gist link of the code: https://gist.github.com/ruoshan/11168592
    why creating a ffi ctype `double [1]`, copying the raw string into it and 
convert the `double` to number is slower.

(note: the `double_fast` function is taken from lua-MessagePack.)


Other related posts: