[Ecls-list] Name of init function.

Waldek Hebisch hebisch at math.uni.wroc.pl
Fri May 30 22:42:28 UTC 2008


Juan Jose Garcia-Ripoll wrote:
> On Fri, May 30, 2008 at 9:13 PM, Waldek Hebisch
> <hebisch at math.uni.wroc.pl> wrote:
> > Looking at other build logs I see that ECL used the same prefix
> > _eclIQwoAUxR6I1_ for several other files.  I wonder why ECL is using
> > so short names (only 18 variable characters in the name).
> 
> It does not make sense to use more, because ECL is using a hash key
> which is produced with the usual hashing routines in the library.
> Hence, it cannot be larger than 32/64 bits, depending on the platform.
> Now, it seems that the hash key for the pathname (which makes the
> "prefix" or first half of the name) is not good enough.

You mean standard Lisp hash function?  This does not look like
good choice.  Namely, such hash function is used to implement
hash tables and hash tables still work even if there is a lot
of collisions.  But for init function we need unique names...

To get unique names I would use something like md5sum or SHA,
but then you need more bits: single char gives us less then 6
bits, so 18 chars give only 108 bits.  md5sum needs 128 bits
and SHA 160.

> But what is
> shocking is that the universal time (makes the second half) is not
> different from one to another. You have a too fast computer :-)
>

I wonder which time you use: file times have only 1 second resolution,
so repetions are quite likely.  Also get-universal-time and related
functions seem to have the same low resolution.  In my own programs
I normally use Unix gettimeofdy function (via apropriate wrapper) to
get microsecond accuracy -- that would reduce probability of clash.
 
> > Also, given
> > relative shortness of the name using strong hash which mixes well
> > all ingredients seem preferable compared to current method which
> > seem to separately encode components.
> 
> As I said, it is not just concatenation, there is hashing involved.
> But perhaps I have not made proper use of the hash routine when
> composing the different elements in the pathnames.
>

Well, the first part seem to depend only on filename: in 6 different
builds (using the same source files) I got the same first part.
Concerning time part: I see several repetitions, even if hashes
of file name differ.

-- 
                              Waldek Hebisch
hebisch at math.uni.wroc.pl 




More information about the ecl-devel mailing list