>     What the other programmer here and I do is setup an array and push()
>     our lines of output onto it throughout all our code, and print it at
>     the very end.  I'd be interested in seeing benchmarks of this vs.
>     the other methods.  I'll try to find the time to run them. 

handler:
query           | avtime completed failed    rps 
-------------------------------------------------
single_print    |    108      5000      0    890 
here_print      |    110      5000      0    887 
concat_print    |    111      5000      0    876 
aggrlist_print  |    113      5000      0    862 
list_print      |    113      5000      0    861 
multi_print     |    118      5000      0    820 
-------------------------------------------------


unbuffered benchmark

single_print:    2 wallclock secs ( 2.29 usr +  0.46 sys =  2.75 CPU)
here_print:      2 wallclock secs ( 2.42 usr +  0.50 sys =  2.92 CPU)
list_print:      7 wallclock secs ( 7.26 usr +  0.53 sys =  7.79 CPU)
concat_print:    9 wallclock secs ( 8.90 usr +  0.60 sys =  9.50 CPU)
aggrlist_print: 32 wallclock secs (32.37 usr +  0.71 sys = 33.08 CPU)
multi_print:    21 wallclock secs (16.47 usr +  5.84 sys = 22.31 CPU)

buffered benchmark

single_print:    3 wallclock secs ( 1.69 usr +  0.02 sys =  1.71 CPU)
here_print:      3 wallclock secs ( 1.76 usr +  0.01 sys =  1.77 CPU)
list_print:      7 wallclock secs ( 6.41 usr +  0.03 sys =  6.44 CPU)
concat_print:    8 wallclock secs ( 8.23 usr +  0.05 sys =  8.28 CPU)
multi_print:    10 wallclock secs (10.70 usr +  0.01 sys = 10.71 CPU)
aggrlist_print: 30 wallclock secs (31.06 usr +  0.04 sys = 31.10 CPU)

Ouch :( Someone to explain this phenomena? and it's just fine under the
handler.... puzzled, what can I say...


here is the code delta...

  sub aggrlist_print{
    my @buffer = ();
    push @buffer,"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n";
    push @buffer,"<HTML>\n";
    push @buffer,"  <HEAD>\n";
    push @buffer,"    <TITLE>\n";
    push @buffer,"      Test page\n";
    push @buffer,"    </TITLE>\n";
    push @buffer,"  </HEAD>\n";
    push @buffer,"  <BODY BGCOLOR=\"black\" TEXT=\"white\">\n";
    push @buffer,"    <H1> \n";
    push @buffer,"      Test page \n";
    push @buffer,"    </H1>\n";
    push @buffer,"    <A HREF=\"foo.html\">foo</A>\n";
    push @buffer,"    <HR>\n";
    push @buffer,"  </BODY>\n";
    push @buffer,"</HTML>\n";
    print @buffer;
  }


_____________________________________________________________________
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

Reply via email to