Re: FFI hashtable?

  • From: Mike Pall <mike-1503@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 15 Mar 2015 12:33:14 +0100

Luke Gorrie wrote:
> The idea is for the lookup function to take an array of keys and prefetch
> the memory that will be searched for keys and values.

This is not what prefetching is for. The time between the prefetch
and the actual lookup is too short. Software-assisted prefetching is
overrated, anyway, except for very specific use cases.

Out-of-order execution will take care of that, as long as you
properly interleave multiple lookups (which is difficult with hash
tables) and defer the join point (the decision phase) as far as
possible. Then the total latency will be that of the longest path.

--Mike

Other related posts: