in reply to How can I make a hash use less memory
perlfaq3 offers this advice concerning using less memory.
How can I make my Perl program take less memory? In some cases, using substr() or vec() to simulate arrays can be highl +y beneficial. For example, an array of a thousand booleans will take +at least 20,000 bytes of space, but it can be turned into one 125-byt +e bit vector--a considerable memory savings. The standard Tie::Substr +Hash module can also help for certain types of data structure. If you +'re working with specialist data structures (matrices, for instance) +modules that implement these in C may use less memory than equivalent + Perl modules.
I did some playing around with Tie::SubstrHash a while ago, but my results were inconclusive for my purposes, but depending upon your data, it might prove more frugal than using a standard hash.
|
|---|