I ran it on a input of 20 "records" (1173 lines).

Here is the output:

Total Elapsed Time = 5.231984 Seconds User+System Time = 2.941984 Seconds Inclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 85.7 0.014 2.524 1037 0.0000 0.0024 Tie::File::PUSH 84.8 0.014 2.496 1037 0.0000 0.0024 Tie::File::SPLICE 83.1 0.133 2.447 1037 0.0001 0.0024 Tie::File::_splice 67.1 1.930 1.974 1037 0.0019 0.0019 Tie::File::_oadjust 10.4 0.038 0.308 2204 0.0000 0.0001 Tie::File::FETCH 9.18 0.020 0.270 2204 0.0000 0.0001 Tie::File::_fetch 8.19 0.019 0.241 1037 0.0000 0.0002 Tie::File::_mtwrite 6.42 0.110 0.189 5 0.0220 0.0377 main::BEGIN 5.20 0.069 0.153 1037 0.0001 0.0001 Tie::File::_downcopy 4.08 0.120 0.120 2074 0.0001 0.0001 Tie::File::_write_record 3.33 0.034 0.098 2204 0.0000 0.0000 Tie::File::Cache::lookup 2.92 0.038 0.086 1172 0.0000 0.0001 Tie::File::Cache::insert 2.69 0.049 0.079 2074 0.0000 0.0000 Tie::File::_cache_flush 2.65 0.078 0.078 2348 0.0000 0.0000 Tie::File::_read_record 2.41 0.039 0.071 3134 0.0000 0.0000 Tie::File::FETCHSIZE

Obviously, Tie::File::PUSH is killing me, and that is what I thought from the beginning as well, but it seems there's no way to do away with this, atleast with with my simple approach?

Any pointers?


In reply to Re^2: Improving dismal performance - Part 1 by PoorLuzer
in thread Improving dismal performance - Part 1 by PoorLuzer

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.