Re: Hashing
From: Chewy509 (chewy509.doesnt.like.spam_at_austarnet.com.au)
Date: 03/03/05
- Next message: Chewy509: "Re: Hashing"
- Previous message: '\\\\o//'annabee: "Re: Wannabee rejoins the masmforum after being banned"
- In reply to: hutch--: "Re: Hashing"
- Next in thread: Chewy509: "Re: Hashing"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 3 Mar 2005 20:36:51 +1000
Hutch,
Thanks for the insight, I'll look more into other implementations and how
they handle collisions.
Thinking a bit more about it, I can encode 32 characters into 192 bits (each
character being 6bits, and packed). This would ensure zero collisions...
However, I'm a bit concerned that matching hashes (of 192bits in size) might
get a bit expensive as the number of hashes increases... (Or I could reduce
the maximum symbol length to say 16 characters? which would produce a hash
of only 96bits).
Since speed at this time isn't important, I was thinking a single hash table
of 8,000 entries, and just use a simple list for the table. (I was thinking
since the hash algo and table would be limited to only a few areas, updating
it in the future won't be too difficult). Or am I under-estimating the
importance of the hashing algo and hash table structure within a compiler?
* Since symbols can only contain 'a..z','A..Z','0..9','_', I'm only dealing
with 63 characters, which will easily fit into 6bits. Since max symbol
length is 32 characters, 32 x 6 bits = 192bits.
-- Darran (aka Chewy509)...
- Next message: Chewy509: "Re: Hashing"
- Previous message: '\\\\o//'annabee: "Re: Wannabee rejoins the masmforum after being banned"
- In reply to: hutch--: "Re: Hashing"
- Next in thread: Chewy509: "Re: Hashing"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|