A couple of comments.

I have yet to see a case where a hash too large for memory can be managed within a reasonable time frame with tied hash solutions. Tied hashes are just too slow for very large data. If it gets that big, then a database is probably a better solution.

Is your size problem due to having just very large files, or is it because you have a very large number of relatively large files? The possible solution would be very different.

I am regularly comparing truly huge files (hundreds of millions of records), that cannot fit into memory. In my experience (having tried many many things), the fastest way is to use the system sort utility to sort them according to the comparison key and then to read two files sequentially in parallel. The comparison routine is slightly tricky (to make sure you stay in sync), but nothing insurmountable.


In reply to Re: storing hash in temporary files to save memory usage by Laurent_R
in thread storing hash in temporary files to save memory usage by Anonymous Monk

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.