>Martin Stjernholm, Roxen IS @ Pike  developers forum wrote:
>>Pointers are worse. They can contain all sorts of periodicity. An
>
>>it's different for each and every one of them). A prime modulo is very
>>effective to put all such concerns to rest. Maybe there are other
>
>Is Pike doing a lot of pointer hashing?

Well, for everything except integers, floats and objects with
lfun::__hash() (ie most objects, strings, programs, etc) used
as index in a mapping (cf svalue.c:hash_svalue())...

>Incidentally, using a prime module to hash a pointer sounds fine to me,
>it just means that the modulo is part of the hash function.  The only

Multiplying with a suitable prime and then shifting and masking would
most likely be of similar strength, but be much cheaper cpu-wise.

>thing I find "bad design" is if the hash-table lookup forces a prime
>modulo, even if a good hash function has already been used.  We should
>focus on improving the hash functions in general.

Agreed.
  • Lock free hash m... Martin Stjernholm, Roxen IS @ Pike developers forum
    • Lock free h... Jonas Walld�n @ Pike developers forum
      • Lock fr... Martin Stjernholm, Roxen IS @ Pike developers forum
        • Re:... Stephen R. van den Berg
          • ... Martin Stjernholm, Roxen IS @ Pike developers forum
            • ... Stephen R. van den Berg
              • ... Henrik Grubbstr�m (Lysator) @ Pike (-) developers forum
                • ... Stephen R. van den Berg
              • ... Martin Stjernholm, Roxen IS @ Pike developers forum
                • ... Stephen R. van den Berg
                • ... Martin Stjernholm, Roxen IS @ Pike developers forum
    • Re: Lock fr... Stephen R. van den Berg
      • Re: Loc... Martin Stjernholm, Roxen IS @ Pike developers forum

Reply via email to