Hello, I updated the diff [1], it uses function now instead of macros, and added hash function "wt6". I did smoke testing stepping thru the code via the debugger for all hash functions and it looks good, however requires more rigorous testing which I will do later today.
On mixing on hashing function I initially tried the alternative of a separate keyword and settled on using the same keyword when I found the unused nibble in the bit masks. Fwiw, using the separate keyword makes the code a little simpler, but from a end user standpoint (which includes me) I found not having another keyword to be better. It would be great if you can take a look at [1] once more and see if you want anything changed. I did not look hard enough, but can/should I add some configs to tests/ folder and how/do these get run when invoking make, or do you run these in some other manner. Are there any additional tests you would like written? Thanks Bhaskar [1] https://github.com/maddalab/haproxy/pull/1 On Tue, Oct 29, 2013 at 2:13 AM, Willy Tarreau <w...@1wt.eu> wrote: > Hi Bhaskar, > > On Tue, Oct 29, 2013 at 12:44:58AM -0400, Bhaskar Maddala wrote: > > Hello, > > > > Can you please take a look at [1]? Make sure it is what you had in > mind, > > I read thru our conversation here again and I understood that the change > we > > wanted to implement allowed selection of the hash function in addition to > > map-based/consistent and avalance. > > > > The change provide the ability to specify. <> indicates optional > > > > hash-type consistent <sdbm/djb2/wt6> > > hash-type map-based <sdbm/djb2/wt6> > > hash-type avalanche <sdbm/djb2/wt6> > > > > Not all of it is implemented, i am in the middle of testing, but wanted > > any early feed back you might have before i spent a lot of time on it. > > I feel a bit bothered by having the if on the hash type done for > every single character. I'd rather have 3 hash functions that work > on (ptr, len) and call the right one with the string and length > instead. > > It will also allow us to have clean hash functions resusable for > anything else. > > Concerning the config, initially I thought that having a separate > keyword (eg: hash-algo) to set the algorithm was better than mixing > it with the hash-type keyword. But now I'm not completely sure about > this because probably people who want to set the algo will also want > to be sure about the type of hashing they're applying. I'd like to > get other users' feedback on this, particularly those using the > consistent hashing. > > Thanks, > Willy > >