Re: Key lookup optimizations...

  • From: Coda Highland <chighland@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Tue, 1 Sep 2015 12:17:53 -0700

On Tue, Sep 1, 2015 at 12:07 PM, Lance Thornblad
<lance.thornblad@xxxxxxxxx> wrote:

First of all, thanks for the quick response!

I'm actually using the BlitzMax wrapper for LuaJIT. I am not using FFI, but
rather exposing the functions in BlitzMax. I'm not sure if that would be
considered using the C API (you mean lua_pushcfunction?), but I've seen no
slowdown and the machine I'm using is hardly a beast.

Good to know that it caches subs like that...

Yes, memorization might be what I need. The results should be the same,
meaning the object found by the key. I suppose that could be
circumstantial, though.

Lance

(LuaJIT list etiquette note: Put your replies at the bottom of the
message you're replying to, not above it.)

Yes, functions created using lua_pushcfunction have several orders of
magnitude worse performance than calls using the FFI. If performance
is a concern for you, this is going to be your first target -- not
only is the call itself slower but its presence can disable the JIT
compiler for the code around it.

/s/ Adam

Other related posts: