Maybe I should have mentioned several facts I omitted in the original post, sorry. Here comes some background information:
  1. The numbers reported were not single measurements, but resulted from an NYTProf run with the script processing the 1st 100 lines of a template of the file under consideration. I consider this to be enough for getting halfway stable results
  2. Any of the lines processed contains about 30.000 fields. With this number the difference does matter, belief me. In particular as the regular final input file size in production has a range of between 1e4 and 1e5 fields and around 1e6 lines. Thus even saving 10% or 20% of runtime is worth the effort
  3. Thanks for the suggestion of the Benchmark module. Nonetheless I'd rather not repeat the processing 500.000 times as this would mean about 12 days only for line splitting with limited gain of knowledge ;-)
In production with external time measures at least processing seems faster with global than lexical variables. BTW: Using C or Pascal instead and coding splitting, filtering and joining by hand does not seem to gain much here (to be honest: almost nothing), not to mention using provided libraries, which seem to be even slower as they favor generic solutions. This only costs more of programmer's time.

In reply to Re^2: "my" slowing down programs? by jf1
in thread "my" slowing down programs? by jf1

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.