On Wed, 7 Jun 2000, Jeff Norman wrote:
>
>
> Frequently, it's hard to build up an entire output segment without
> code in-between the different additions to the output. I guess you could
> call this the "append, append, append... output" technique.
>
> I think it would be an interesting addition to the benchmark:
>
> sub gather_print{
> my $buffer = '';
> $buffer .= "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">";
> $buffer .= "<HTML>";
> $buffer .= " <HEAD>";
> $buffer .= " <TITLE>";
> $buffer .= " Test page";
> $buffer .= " </TITLE>";
> $buffer .= " </HEAD>";
> $buffer .= " <BODY BGCOLOR=\"black\" TEXT=\"white\">";
> $buffer .= " <H1> ";
> $buffer .= " Test page ";
> $buffer .= " </H1>";
> $buffer .= " <A HREF=\"foo.html\">foo</A>";
> $buffer .= " <HR>";
> $buffer .= " </BODY>";
> $buffer .= "</HTML>";
> print $fh $buffer;
> }
Per your request:
The handler:
query | avtime completed failed rps
-----------------------------------------------
single_print | 110 5000 0 881
here_print | 111 5000 0 881
list_print | 111 5000 0 880
concat_print | 111 5000 0 873
multi_print | 119 5000 0 820
-----------------------------------------------
The benchmark unbuffered:
single_print: 2 wallclock secs ( 2.44 usr + 0.31 sys = 2.75 CPU)
here_print: 4 wallclock secs ( 2.34 usr + 0.54 sys = 2.88 CPU)
list_print: 8 wallclock secs ( 7.06 usr + 0.43 sys = 7.49 CPU)
concat_print: 9 wallclock secs ( 8.95 usr + 0.66 sys = 9.61 CPU)
multi_print: 22 wallclock secs (16.94 usr + 5.74 sys = 22.68 CPU)
The benchmark unbuffered:
single_print: 1 wallclock secs ( 1.70 usr + 0.02 sys = 1.72 CPU)
here_print: 1 wallclock secs ( 1.78 usr + 0.01 sys = 1.79 CPU)
list_print: 7 wallclock secs ( 6.44 usr + 0.05 sys = 6.49 CPU)
concat_print: 9 wallclock secs ( 8.04 usr + 0.06 sys = 8.10 CPU)
multi_print: 10 wallclock secs (10.56 usr + 0.09 sys = 10.65 CPU)
The interesting thing is that list_print and concat_print are quite bad in
the benchmark but very good in the handler. The rest holds.
>
>
>
> On Wed, 7 Jun 2000, Stas Bekman wrote:
>
> > Following Tim's comments here is the new benchmark. (I'll address the
> > buffering issue in another post)
> >
>
>
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:[EMAIL PROTECTED] http://perl.org http://stason.org/TULARC
http://singlesheaven.com http://perlmonth.com http://sourcegarden.org