Since I'm assuming all the other posters were running under a unix of some sort, and though it might well make a difference, here's some numbers for win32 (win xp, perl 5.6.1, ActiveState build 630):

D:\Documents and Settings\James\Desktop>perl timereads.pl Benchmark: running join, slurp, sys, while, each for at least 5 CPU se +conds... join: 6 wallclock secs ( 3.92 usr + 1.33 sys = 5.25 CPU) @ 28 +23.36/s (n =14817) slurp: 5 wallclock secs ( 2.39 usr + 2.88 sys = 5.28 CPU) @ 58 +13.53/s (n =30678) sys: 5 wallclock secs ( 0.01 usr + 5.06 sys = 5.07 CPU) @ 11 +.25/s (n=5 7) while: 5 wallclock secs ( 4.03 usr + 1.28 sys = 5.31 CPU) @ 28 +34.21/s (n =15044) Rate sys join while slurp sys 11.2/s -- -100% -100% -100% join 2823/s 24998% -- -0% -51% while 2834/s 25095% 0% -- -51% slurp 5814/s 51579% 106% 105% --

(I used D:\WINXP\system32\oembios.bin (12.5 MB, and a significantly lower proportion of newlines.), and "at least 5 cpu seconds" of time, so these numbers have slightly different bases then belg4mit's.)

Note how terribly sys does in my comparisigns. These are completely different results, in essence, which confuses me a lot.

This is rapidly getting offtopic, but does anybody have a clue why?

TACCTGTTTGAGTGTAACAATCATTCGCTCGGTGTATCCATCTTTG ACACAATGAATCTTTGACTCGAACAATCGTTCGGTCGCTCCGACGC

In reply to Re: Re: Reading entire file into scalar: speed differences? by theorbtwo
in thread Reading entire file into scalar: speed differences? by theguvnor

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.