Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"03-25-15 - Density - Chameleon"

2 Comments -

1 – 2 of 2
Blogger Unknown said...

Looking at Chameleon, it is very simple. The only tweak-able part of the algorithm seems to be the hash function. It needs to be very fast and collisions directly reduce the compression rate.

I see they chose to do an unsigned 32-bit multiplication with a 'big' even number (2641295638 = 2*79*3541*4721) and then take the top half.

My first instinct would be to multiply with big prime; I am not sure what part to take (bottom half may or may not be faster?).

Do you have any insights about the hash function they chose?

March 26, 2015 at 7:17 AM

Blogger cbloom said...

Hashing for compression in cache tables like this is a bit weird. You don't actually want the most random-valued hash (the way you would for normal hash table lookup). I wrote a bit about it before :

http://cbloomrants.blogspot.com/2010/11/11-19-10-hashes-and-cache-tables.html

There are endless options to play with, and what's fastest will depend highly on your platform.

March 26, 2015 at 8:03 AM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.