On Tue, Nov 05, 2002 at 03:20:57PM +0000, Paul Makepeace wrote:
> On Tue, Nov 05, 2002 at 01:20:15AM +0000, David Cantrell wrote:

> > Scaling perl CGIs up to a few hundred a second is merely hard, but not
> > impossible.
> 
> Definitely on the "difficult" side of "hard" :-)

Agreed.

> $ time perl -e '$a = `perl -le "print q[hello]"` for (1..200)'
> real    0m1.068s
> user    0m0.600s
> sys     0m0.380s
> $ host -t hinfo paulm.com
> paulm.com               HINFO   "Intel-1.8GHz-P4" "Debian-GNU/Linux"
> $
> 
> For fun,
> 
> $ time perl -e '$a = `perl -MCGI -le "print CGI->header, CGI->h1(q[hello])"` for 
>(1..200)'
> real    0m10.329s
> user    0m8.400s
> sys     0m0.990s
> $


$ time perl -e '$a = `perl -le "print q[hello]"` for (1..200)' 
real    0m2.353s
user    0m1.350s
sys     0m0.960s
$ time perl -e '$a = `perl -MCGI -le "print CGI->header, CGI->h1(q[hello])"` 
for(1..200)'

real    0m22.025s
user    0m19.560s
sys     0m2.350s


Here's the first 1%:

$ time perl -e '$a = `perl -MCGI= -le "print CGI->header, CGI->h1(q[hello])"` 
for(1..200)'

real    0m21.659s
user    0m19.370s
sys     0m2.280s

Scarily, here's another 29%:

time perl -e '$a = `perl5.00503 -MCGI= -le "print CGI->header, CGI->h1(q[hello])"` 
for(1..200)'

real    0m15.654s
user    0m13.930s
sys     0m1.610s

(perl was 5.8, 5.6.1 built by me, so probably the same compiler options as
the other two is:

real    0m20.931s
user    0m18.340s
sys     0m2.470s
)

I think using 5.005_03 is a fair speedup, given that your example isn't using
any 5.6.1 features (yet), and isn't tickling any 5.005_03 bugs.

"Obviously" real optimisation problems aren't this simplistic.

Nicholas Clark

Reply via email to