[Mesa-dev] [PATCH 2/4] util: Change hash_table to use quadratic probing

2017-02-08 Thread Thomas Helland
This will allow us to remove the large static table and use a power of two hash table size that we can compute on the fly. We can use bitmasking instead of modulo to fit our hash in the table, and it's less code. By using the algorithm hash = sh + i/2 + i*i/2 we are guaranteed that all retries fro

Re: [Mesa-dev] [PATCH 2/4] util: Change hash_table to use quadratic probing

2015-03-16 Thread Eric Anholt
Thomas Helland writes: > This should give better cache locality, less memory consumption, > and should also be faster since we avoid a modulo operation. > Also change table size to be power of two. > This gives better performance as we can do bitmasking instead of > modulo operations for fitting

Re: [Mesa-dev] [PATCH 2/4] util: Change hash_table to use quadratic probing

2015-03-14 Thread Connor Abbott
On Sun, Mar 15, 2015 at 1:25 AM, Connor Abbott wrote: > On Fri, Mar 13, 2015 at 6:37 PM, Thomas Helland > wrote: >> This should give better cache locality, less memory consumption, >> and should also be faster since we avoid a modulo operation. >> Also change table size to be power of two. >> Thi

Re: [Mesa-dev] [PATCH 2/4] util: Change hash_table to use quadratic probing

2015-03-14 Thread Connor Abbott
On Fri, Mar 13, 2015 at 6:37 PM, Thomas Helland wrote: > This should give better cache locality, less memory consumption, > and should also be faster since we avoid a modulo operation. > Also change table size to be power of two. > This gives better performance as we can do bitmasking instead of >

[Mesa-dev] [PATCH 2/4] util: Change hash_table to use quadratic probing

2015-03-13 Thread Thomas Helland
This should give better cache locality, less memory consumption, and should also be faster since we avoid a modulo operation. Also change table size to be power of two. This gives better performance as we can do bitmasking instead of modulo operations for fitting the hash in the address space. By u