Hi,

actually - don't overestimate the power of Storable. Here are some benchmarks we did, because we tried to harness storables power and failed(?):

We have a large hash. Where there is a key and the value is a list of sets of strings. We had an OLD method to store them:

Extracting these strings (iterating the whole data structure), concatenating them in a sensible way (unique delimiters) and storing them to disk.

And we tried a new way: Store them via Storable.

Storable was about 7 times slower than the old method when saving the data, about 5 times faster when retrieving the data and took about 10 times more space on disk.

For our special purposes, we decided to stick with the old method, but you may find it worth to try storable. It's way easier and consistent. On the other side - even though it saves everything in a binary form it still needs much space on disk as it saves the complete data structure too.

You might save that space, when rebuilding that data-structure on the fly while reading the data in.

Bye
 PetaMem


In reply to Re: Re: Efficient memory by PetaMem
in thread Efficient memory 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.