Re: Key lookup optimizations...

  • From: Javier Guerra Giraldez <javier@xxxxxxxxxxx>
  • To: LuaJIT <luajit@xxxxxxxxxxxxx>
  • Date: Tue, 1 Sep 2015 14:19:06 -0500

On Tue, Sep 1, 2015 at 1:47 PM, Coda Highland <chighland@xxxxxxxxx> wrote:

A question to be asked: Are you using the Lua C API for exposing
functions to scripts, or are you using FFI? The former is RIDICULOUSLY
slow; the latter is nearly as fast as if you had made the same call in
C.

contrary to common repeated advice, the C API is _not_ slow in LuaJIT.
It's just as fast as it is in plain Lua.

Of course, FFI is far faster, but sometimes it's even faster to
manipulate FFI structs with Lua code, especially if you attach methods
with ffi.metatype()

--
Javier

Other related posts: