FFI hashtable?

  • From: Luke Gorrie <luke@xxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 13 Mar 2015 20:09:39 +0100

Howdy,

I'm looking for a suitable FFI hashtable to use with LuaJIT. The use case I
have in mind is hashtables with fixed-size keys and values (C structs of
1-64 bytes fixed at creation time). Up to around one million elements per
table. I'd like a short and simple implementation.

I am currently investigating khash and looking at adapting its API to the
FFI:
https://github.com/attractivechaos/klib/pull/45

Any hot tips?

In a perfect world I would actually love something that supports key->value
lookups, in-order traversals, and longest-prefix matching. I say this just
in case anybody knows of such a unicorn. I'm okay with focusing on
key->value lookups for the moment.

Cheers,
-Luke

Other related posts: