I have a program which collect data and save it in binary file, It can build a index file IDX.txt with 5 columns ( UID,SecID,Date,Time,address), address is a pointer to data. That program's work flow as below /1. load index as a HoA/ /2. waitting for task/ when get a task, it will do /A. search index HoA to find a new entry and new UID / /B. write data and update index HoA / /C. sort index HoA and Save it to IDX.txt file/ As time goes by, I find the IDX.txt is larger than 100M It is very slow when I load IDX.txt and search HoA (grep, sort ). It is necessary to hold Index HoA when program is running, Is there any better way to go through this problem? I am wondering whether Cache module is a better solution, maybe any other module? thanks

In reply to How to deal with a mass HoA by jiwei800715

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.