Please, if you are going to post a benchmark and results, do so responsibly. The code you posted has (at least) two errors:

timethese( 100], {

Where'd that spurious ']' come from? I realize this was probably a cut-n-paste error, but still...

open PROG, ">/dev/nul";

This one is more serious. It implies that you tested printing your strings to a non-existent file handle. Ooops.

Benchmark: timing 100 iterations of join, local, manual...

Wait... what about 'html'? So, I guess you ran that later and added it into your results?

I probably would have missed all of this had I not been suspicious of your results. I would have guessed the 'html' version to be the fastest by far... so I had to check for myself. Here are the results I got, after correcting the errors noted above:

Benchmark: timing 100 iterations of html, join, local, manual... html: 46 wallclock secs (45.58 usr + 0.05 sys = 45.63 CPU) @ 2 +.19/s (n=100) join: 220 wallclock secs (219.65 usr + 0.07 sys = 219.72 CPU) @ + 0.46/s (n=100) local: 221 wallclock secs (220.61 usr + 0.14 sys = 220.75 CPU) @ + 0.45/s (n=100) manual: 866 wallclock secs (864.92 usr + 0.26 sys = 865.18 CPU) @ + 0.12/s (n=100)
For completeness:
$ prtdiag | head -3 System Configuration: Sun Microsystems sun4u 4-slot Sun Enterprise 3 +000 System clock frequency: 84 MHz Memory size: 1024Mb
To double check those findings, I ran it on a PC as well:
Benchmark: timing 100 iterations of html, join, local, manual... html: 7 wallclock secs ( 6.36 usr + 0.01 sys = 6.37 CPU) @ 15 +.70/s (n=100) join: 22 wallclock secs (22.27 usr + 0.01 sys = 22.28 CPU) @ 4 +.49/s (n=100) local: 22 wallclock secs (22.46 usr + 0.02 sys = 22.48 CPU) @ 4 +.45/s (n=100) manual: 76 wallclock secs (75.38 usr + 0.01 sys = 75.39 CPU) @ 1 +.33/s (n=100)
And, again, for completeness here is some system info:
Linux 2.4.18-14 model name : Intel(R) Pentium(R) 4 CPU 2.40GHz stepping : 4 cpu MHz : 2405.502 cache size : 512 KB MemTotal: 513908 kB MemFree: 388036 kB

Frankly, I still don't know how you managed to get such poor figures for the 'html' code.

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Re: pipes and return data by sauoq
in thread pipes and return data by Anonymous Monk

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.