Hi monks,
I have been working on a web based bioinformatics program written in Perl by a non programmer.
My goal is to try and make it work faster. One thing I noticed is that the program creates huge hashes (millions of keys) that are the same nearly every time (according to the input).
What I did was create these hashes before hand, and store them using Storable.
Then, each time the program runs, I retrieve them, thus saving a lot of time (it works in about half the time now)
Problem is, retrieving the hashes still takes a very expensive 12 seconds (out of 18 seconds it takes the program to run).

My questions are:

1)Whether there are other serialization modules that are faster than Storable?

2)Any other word of advice how to make very large hashes work faster?

I know the best solution is to try and rewrite the program, but I'm not sure that's an option now. I also tried to store the data in a DB, but the program then requires many DB calls which takes too much time.
Thanks in advance,
mrguy123

I have yet to see any problem, however complicated, which, when you looked at it in the right way, did not become still more complicated. - Poul Anderson


In reply to Fast(er) serialization in Perl by mrguy123

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.