Tom Christiansen <[EMAIL PROTECTED]> writes:

> I would like to console people against using the fancy IO 
> modules, or at least, not to do so without knowing what they're
> getting into.  Look at where we are now:
> 
> % wc `perl -MIO -e 'print join("\n", sort values %INC, "")'`

[snip] 

> The following numbers show memory sizes (virtual and resident) for
> v5.6 of Perl on four different operating systems, The three calls
> each are without any modules, with just -MCGI, and with -MIO (never
> with both):
> 
>                 OpenBSD       FreeBSD      Redhat       Solaris   
>                 vsz   rss     vsz  rss     vsz  rss    vsz    rss
>     Raw Perl    736   772     832 1208    2412  980    2928  2272 
>     w/ CGI     1220  1464    1308 1828    2972 1768    3616  3232
>     w/ IO      2292  2580    2456 3016    4080 2868    5384  4976
> 
> Anybody who's thinking of choosing one of these might do well to
> stare at those numbers for a while.  

This is mitigated somewhat by loading the modules once on a cold start
and letting them propogate to child httpd's via fork.  This helps with
the memory and startup time.  It's unfortunate that those modules are
so large, but with perl and websites the tradeoff is usually memory
for performance.  Since it's easier to double the RAM of a system than
to double the CPU speed, many consider it a fair trade. :)

Of course, I suspect you knew that, but maybe not everyone does.

I am curious; do you advocate not using such modules, or do you
advocate a simpler API of some sorts?  Perl sucks memory, no two ways
about it.  CGI.pm is huge and tries to do everything, which is rarely
a good thing.  IO provides a needed, though costly, OO interface to
most system calls.  What alternatives are there really besides
rewriting and breaking those modules up, as has partially been done
with some Apache modules vs CGI.pm.  I'm not aware of any similar
attacks on IO.

Chip

-- 
Chip Turner                   [EMAIL PROTECTED]
                              ZFx, Inc.  www.zfx.com
                              PGP key available at wwwkeys.us.pgp.net

Reply via email to