hi
On Fri, 2003-04-25 at 14:12, Ragnar Kjørstad wrote:
> I assume there are also some extra bits in set_no to reduce the chance
> of hash duplicates. NL_SETMAX is 255 on Solaris 8, so that should
> provide us with 23 bits on this system.
>
> How many unique strings are we translating?
>
> For 1000 strings the chance of a collition is approxemately 6% - So most
> likely there are _none_ collisions, and if there is one we can probably
> fix it with an ugly hack. (split it in two, or add a space)
and how to know that it was a collition?
you have to store it somewhere.
splitting the errormessages in more than one catalogues, i.e for every
log-proprity one catalogue could decrease the probability of collitions
> More strings than that, and we quickly run into problems - with 10.000
> strings the probability of at least one collision is 98.75%, and I guess
> it's likely we will have multiple collisions (allthough I have not
> calculated how many) at this point.
> Another way of generating setid and msgid automaticly is with __LINE__
> and __FILE__ macroes - could that work? And would that eliminate the
> collision_problem?
then you have different id's for probably the same errormessages
i think the first solution is the better one.
peter
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
|