lua-users home
lua-l archive

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


On Thu, Jun 27, 2013 at 9:06 PM, Eric Wing <ewmailing@gmail.com> wrote:
>> It's only expensive to use the Lua C API when working with LuaJIT, and then
>> only relatively - there the strategy is to use the compiled FFI interface.
>
> Do you have any numbers/stories you can share about how the FFI
> performance compares? (I've dealt with libffi myself in LuaCocoa but
> haven't benchmarked it. Marshaling parameters to and from ffi data
> structures was quite tedious to write but I never benchmarked how that
> translated to speed in practice.)

The LuaJIT ffi when JIT compiled has no overhead at all, it is just
the same as a C to C call. But iOS does not support JIT, which means
calling the ffi API it is actually slower than calling the standard
Lua C API.

Justin