The first hashing algorithm WAS Perl's implementation more than decade ago. It is more complex now, but I'm sure that it is still very, very fast.

Again this code is NOT Perl. But it does use Perl concepts. I am sorry if this more confusing than helpful.

It also surprised me to see that the address to the key is hashed and not the string of the key.
There is a misunderstanding here - perhaps caused by some C misunderstanding? The address to the key is not hashed. A binary memory address "IS the key". In Perl, a hash key must (or used to be) be ascii. In version 1, I converted this binary hash key to ascii to run the Perl algorithm upon it. The second algorithm doesn't convert the binary value to ASCII and uses just binary operations directly.

We are getting way "off topic" if we talk about 68000 vs modern Intel/AMD processors. I worked at one time with Bob Childs, who invented the Intel 286 memory segmentation stuff to make it compatible with what Intel could do within the limits of backward compatibility etc. Bob was a very smart, albeit argumentative guy. I miss him.


In reply to Re^9: can I change hash keys or values directly by Marshall
in thread can I change hash keys or values directly by misterperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.