There is no way to answer your question. Sure, if you're working with smaller hashes, maybe your program's performance would improve. Maybe it would degrade, though, depending upon how many buckets the keys would be allocated to (unlikely, but this is just an illustration). That would depend upon the keys. Further, if it takes a longer to delete those keys than the savings you would get from working with a smaller hash, then it's a waste of time. And what about the value of your time? If this program runs once a week for about 30 minutes, is it really worth it?

In any event, figure out what's important to you and if you think that deleting those keys might help, check out the Benchmark module. It comes standard with Perl.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to (Ovid) Re: Comparing two hash tables by Ovid
in thread Comparing two hash tables by Rajiv

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.