Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Abigail-II did a lot of benchmarking on it. Maybe Abigail-II would like to elaborate?
The benchmark was fairly simply: take about million different words, insert them in a hash, measure how long it takes and what the average chain length is. They are all common words, it's the combination of various English wordlists I once grabbed from a puzzle site, and long list of Dutch words. No specially prepared input. The average chain length was 1.27 on 5.8.0, 5.8.1, 5.8.2-RC1 and 5.8.2-RC2. The only interesting thing was the time - it took about 17.5 seconds on 5.8.0, 5.8.1 and 5.8.2-RC2, and less almost 4 seconds less on 5.8.2-RC1.
A same hash key list length of 1 for all hash keys, would be optimal if there were no other "costs" involved. However, the re-hashing of existing keys is not something to be done lightly, especially if the number of existing keys is high. So you need to find the best possible combination of same hash key list length and re-hashing. In that respect, the ideal same hash key list length is not 1!
I do not agree with the latter conclusion. The best possible combination of max chain length and re-hashing depends on the ratio number of inserts vs number of queries (for the sake of simplicity, let's not consider deletes). The lower this ratio is (that is, the more queries you have), the more time you can spend on inserts to get a better overal performance. That is, if you have enough queries, it pays to have max chain length of 1.

Abigail


In reply to Re: A short meditation about hash search performance by Abigail-II
in thread A short meditation about hash search performance by pg

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    [Corion]: "Unmatched ) in regex; marked by <-- HERE in m/(&#9583;&# 9633;)&#9583;&# 65077; &#9531;&#9473;&# 9531;) <-- HERE / at -e line 1." :)
    [Corion]: Meh - my "flip the table" string doesn't render here ;)

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (8)
    As of 2018-07-17 16:06 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















      Results (372 votes). Check out past polls.

      Notices?