On Wed, 2003-11-19 at 17:17, Christopher P. Lindsey wrote:
>    However, I've noticed that scripts that generate lot of output take
>    substantially longer to run than their CGI counterparts.
> 
>    As an example, here's the timing on a CGI script (listed first) and
>    the timing on a mod_perl aware script (listed second):
> 
>       [113]> time lynx -dump -mime-header 
> http://www.hort.net/cgi-bin/gallery/photographer/lindsey > /dev/null
>       0.010u 0.030s 0:01.59 2.5%      0+0k 0+0io 393pf+0w
> 
>       [114]> time lynx -dump -mime-header 
> http://www.hort.net/perlssi/gallery/photographer/lindsey > /dev/null
>       0.010u 0.000s 0:03.38 0.2%      0+0k 0+0io 393pf+0w
> 
>    The CGI script took 1.59 seconds to run, whereas the mod_perl version 
>    took 3.38 seconds.  It generates about 321K of output.

Are you positive that they generated identical output?

>    Why does this happen?  My handlers are set up like
> 
>       PerlSetVar Filter On
>       PerlModule Apache::Filter Apache::RegistryFilter Apache::SSI
>       PerlHandler Apache::RegistryFilter Apache::SSI

How were you doing this filtering in your CGI script? 

>    I'm guessing that it's because Apache::Filter loads the output of
>    each filter into memory before passing it on. 

That's a good guess.  Why don't you profile it and find out where the
problem is?  Try Apache::DProf.

- Perrin


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html

Reply via email to