Re: Possible to store a reference to a lua table in an ffi struct?

  • From: Kaj Eijlers <bizziboi@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 21 Mar 2014 23:18:19 -0700

> I know this will seem inefficient at first (two globals + double
> indirection!). But we write high performance numerical computing code and
> this has never been a bottleneck for us. If this ends up being your
> bottleneck you are probably already very close to optimality anyway (or,
> alternatively, need to ditch hash maps as your record structure and start
> using C structs).
>
> Demetri
>

Thanks, I like the idea (would have dismissed it if I came up with it
myself but - in the end the std:vector would add indirections as well, and
the array lookup should be pretty cheap since it's only the integer part of
the array.
Just saw your message about the metatable on top of it, it seems I have
something to play with!

Kaj

Other related posts: