Ok, you'd get surprised on this one. I cannot make benchmark show me
unbuffered output worse than buffered. Anyone can tell me why? there is
ap_flash call after each print in the unbuffered case, how comes the
results are the same?

name         | avtime completed failed    rps 
----------------------------------------------
buffering    |    324      5000      0    151 
unbuffering  |    325      5000      0    150 
----------------------------------------------

I've tried to print the average page size of about 64k to make as close as
possible to the real world test, but certainly using a way too many print
calls... still it doesn't change the results. I'm probably missing
something... can you see what it is?

The code:

package UnBuffered;
use Apache::Constants qw(:common);
local $|=1;
sub handler{
  my $r = shift;
  $r->send_http_header('text/plain');
  my $string = "a" x 128;
  for (1..512){
    print $string,"\n";
  }
  return OK;
}

1;

package Buffered;
use Apache::Constants qw(:common);
sub handler{
  my $r = shift;
  $r->send_http_header('text/plain');
  my $string = "a" x 128;
  for (1..512){
    print $string,"\n";
  }
  return OK;
}

1;


Thanks!


_____________________________________________________________________
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