Just as a simple I/O test, I played around with just creating a 500MB file and then copying that file to another file on my old WinXP machine.
#!/usr/bin/perl -w use strict; my $begin = time(); open (BIG, ">fiveHundredMB") or die "cannot open file for 500MB write" +; my $c255 = '*'x255; my $c256 = "$c255\n"; my $oneK = "$c256"x4; my $oneMB = "$oneK"x1024; print BIG $oneMB for (1..500); close BIG; my $end = time(); print "elasped time for 500MB file is: ", $end-$begin, " seconds\n"; __END__ elasped time for 500MB file is: 9 seconds I opened this file in my text editor and there are 2,048,000 lines of 256 chars = 524,288,000 bytes. Windows says: 526,336,000 bytes at command line. This difference is a mystery to me at the moment. But this is basically a ~500 MB file.
#!/usr/bin/perl -w use strict; my $begin = time(); open (BIG, "<fiveHundredMB") or die "cannot open file for 500MB read"; open (OUT, ">bigfile") or die "cannot open bigfile for write"; while (<BIG>) { print OUT $_; } close OUT; my $end = time(); print "elasped time for 500MB file is: ", $end-$begin, " seconds\n"; __END__ prints: elasped time for 500MB file is: 13 seconds
Even at 22 seconds, the execution time seems slow, but that depends upon the number of regex'es you are running per line of input and how many lines that there are. I suspect that they are far less than 1024 bytes in length on average. If your performance is adequate for your use, I would stick a fork in it and call it done! I wouldn't worry about it. About 13-14 seconds is as fast as a single HD can go without any processing of the data.

In reply to Re^5: Splitting Apache Log Files by Marshall
in thread Splitting Apache Log Files by cmm7825

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.