This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Add objc-lang.c, further cleanup - TAKE TWO

Zack Weinberg wrote:-

> Reference?  I'd like to see this.

Starts on 27th.  It's a long thread (breaks into two IIRC); probably
about 100 posts altogether.  One conclusion was that FNV is nothing
particularly special.  Another interesting one was that one of the
hash functions, Lennart I think, was good for text (but not
exceptional) but truly sucked for binary data.
> Just yesterday I found an old letter from someone suggesting I try just
>    hash = hash * 9 + ch
> for the hash step.  If you have a harness set up to do these tests
> already, mind trying that one?

I think that might have been one they tested.  ... OK you persuaded
me.  [Digs around].  Here's the results with my data with one test
harness a guy posted (someone else had a larger set of hashes but
didn't post his harness):

dragon: {171} ./hashtest b 262144 28 < rnd
total items:  182857
hash dumb         used   2616   max    221   time 0.342sec
hash fnv          used 131638   max      7   time 0.674sec
hash lennart      used  61454   max    743   time 0.790sec
hash crc          used 131494   max      8   time 0.547sec
hash perl         used 131856   max      7   time 0.497sec
hash mouse        used 131573   max      6   time 0.607sec
hash gcc          used 131531   max      7   time 0.497sec
hash gcc2         used 131531   max      7   time 0.492sec
hash zack         used 131343   max      8   time 0.398sec
dragon: {172} ./hashtest s 262144 < ../files
total items:  84530
hash dumb         used   5026   max     60   time 0.277sec
hash fnv          used  72152   max      5   time 0.465sec
hash lennart      used  47616   max      8   time 0.554sec
hash crc          used  69264   max     37   time 0.399sec
hash perl         used  72216   max      6   time 0.358sec
hash mouse        used  71357   max      6   time 0.432sec
hash gcc          used  72191   max      6   time 0.357sec
hash gcc2         used  72270   max      5   time 0.362sec
hash zack         used  72333   max      6   time 0.304sec

so it looks pretty good for text; possibly not so hot for binary.
(gcc and gcc2 are the cpplib hashes; gcc2 doesn't add "len" add the
end).  Obviously the times aren't precise, but they are an indication.
A better harness would take the s.d. of the hash lengths, and not just
the max.

The post referencing this harness is


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]