lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 2/27/2017 3:12 AM, Daurnimator wrote:
> I read this today:
> https://probablydance.com/2017/02/26/i-wrote-the-fastest-hashtable/
> I thought it might be interesting reading for many of you.
> 
> I'm eager to see how lua's algorithm compares, and what lessons might be learnt.

I'm not familiar with Lua's algorithm for hash tables, but removing the
bounds check for the array in the inner loop by having allocating a
slightly larger array reminds me of removing the bounds check in
insertion sort by placing the smallest/largest element at the
beginning/end, respectively, based on which way you search the array.
That's a really awesome insight.