I think MLDBM uses the Storable routines. You might be able to squeeze some performance by using Storable directly?

I think it will depend most on how you are using the data. If you are looking at every record in the database each time, I'm not sure any of these solutions will be faster than reading the text file like you are now.

If you need access to a limited number of records at a time, DBM performance should eventually be better, given enough records.

DBM is easy to try and good to know. Performance is hard (for me) to guess. So give it a shot, let me know how it goes!

Regarding your list of hashs, provide a key and it becomes a hash of hashes.

You access $pics{'MeAndDog'}->{date}. Now it's DBM-able. Use MLDBM if you have complex data to store, but keep in mind MLDBM and Storable are stringifying and unstringifying the data, not sure of the performance hit.

If each picture simply has a list of attributes, you can combine the key and the attribute to make a new hash key and use a simple DBM. So you access $dbm{'MeAndDog.date'}, $dbm{'MeAndDog.size'}, $dbm{'MeAndDog.text'}, etc.

HTH helps, had to rush the reply cause I'm outta here!

YuckFoo, happy to have had the opportunity to use 'unstringifying'.


In reply to Re: Re: Re: Desperately needing help with Storable by YuckFoo
in thread Desperately needing help with Storable by wanderingM

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.