I routinely use hashes of 50K or 100K keys and sometimes several at once! This is not an issue if you have enough memory. Also, the Perl hash table is very efficient performance wise. If you know what you are looking for, no other data structure is as efficient.
I suspect that your trouble will be the same as mine. Where does this stuff that goes into the hash come from? In my case the data comes from text files and the "care and feeding" of these text files just dwarfs any hash table initialization or should I say that getting the data off the disk and ready to be inserted into the hash and creating the text output files is what takes the VAST majority of the MIPs, split(), regex and such. I/O is "expensive". Anyway 50K keys is not what I would consider a huge hash. If your app gets slow, then look at your I/O stuff and benchmark it. You can make some significant performance gains there with some experimentation.
Anyway I/O is gonna be the performance problem, not the hash itself.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.