Hi Chris,
Tries are usually used for alphabetic keys and depending on the spread
of the keys it can be faster and have a smaller memory imprint than
hash-tables, but Tries are bad if key lengths are long as they usually
store the unique part of the key (plus pointers for each letter in
worst case).
Nedtries are a good idea to try out, and overriding a couple of
functions in dict.c should suffice (as well as commenting out anything
having to do w/ rehashing), but possibly the question to ask
beforehand is what needs to be tested.
Its easy to come up w/ a test that shows nedtries destroy hash-tables
and another test that shows the opposite.
There are no tools around that test the wide wide spectrum of data
that redis can hold, and w/o such tools, a single test proves too
little. Creating such tools is also HARD, but I guess for this
specific test, performing speed and memory tests while varying key-
length would be pretty meaningful.
Not all Nosql engines use hash-tables, some use B+Trees which are
slower, but much more memory efficient and are sorted.
I overrode the hash code in dict.c w/ some B+Tree code, and it
performed at about 60-70% the speed of the hash table, but the memory
usage was drastically improved (w/ some optimisations). The exact
benchmarks to illustrate this are difficult as the additional variable
of where the value in the key-value tuplet was stored greatly
decreased memory usage (so benchmarking has to vary value-size).
I am trying to say, if you do override the hash-table w/ a nedtrie (or
whatever), make sure you come up w/ some meaningful tests/
benchmarks ... a topic I am definitely interested in.
- Jak