On Sun, Mar 07, 2004 at 02:46:52AM +1300, Sidney Markowitz wrote:
> if it was a good one. A fixed four bytes per token should really 
> decrease storage requirements and increase speed.

Well, agreed, sorta... ;)  Storage Requirements would definitely go
down -- in my quick test (using 8byte crc64-generated hash keys instead
of raw tokens) the DB went from 23.5MB to 20.9MB.  Not huge.  If I used
a 4byte crc32-generated hash key, strangely, it goes up to 21.0MB.

Speed does go up, but not significantly.  See my previous mail for
details, but I found that read-only speed went from 11.4s to 11.25s
(raw vs 8byte hash tokens).  That factored in with the extra CPU time
required to do hashing in our code would make us net about the same.

> There is no reason to use the slower SHA-1 instead of MD5 when you are 
> not concerned about cryptographic strength. We just want a collision 
> resistant hash. Truncating MD5 to 64 or 32 bits should be fine. There 

Yeah.  The issue is that we already use SHA1 in our code, and adding CRC##
or MD5 would require a new dependency.

> In any case, if we can accept a collision rate of less than one in two 
> billion, we should test using a good 32 bit hash that is not CRC32, 
> rather than just a 64 bit hash.

Sure.

-- 
Randomly Generated Tagline:
I guess Bart's not to blame.  He's lucky, too, because it's spanking
 season, and I got a hankering for some spankering!
 
                -- Homer Simpson
                   Two Dozen and One Greyhounds

Attachment: pgpXeWt9esXO7.pgp
Description: PGP signature

Reply via email to