On Tue, 21 Nov 2000, Matt Sergeant wrote:

> This is a bit off topic as its not specifically mod_perl, but I wrote it
> for use in a mod_perl environment, so I figure it will be useful to other
> people.
> 
> HTTP::GHTTP is a lightweight HTTP client library based on the gnome
> libghttp library. It offers a pretty simple to use API for doing HTTP
> requests. This can be useful under mod_perl because the alternatives
> (e.g. LWP) are quite large.

I should clarify this... LWP::UserAgent loads about 110K of Perl code (*).
And Perl code compiles to more memory than the pure text form of Perl (I
haven't tested exactly how much memory it uses though). HTTP::Lite loads
about 71K of Perl code (which surprised me!). HTTP::GHTTP loads about 24K
of Perl code (note that GHTTP.pm is only 746 bytes of actual Perl, so most
of that 24K is the same 24K as loaded by the other 2 modules, Exporter,
AutoLoader, Dynaloader, strict, etc, so these will be loaded into your
mod_perl anyway). HTTP/GHTTP.so is about 14K stripped on my Linux box. So
even unshared its not going to have a big impact on your servers. And
GHTTP does all its work in C - the only thing in Perl is the constructor.

(*) using: perl -M<module> -e 'print join("\n", values %INC)' | xargs cat
| /tmp/nopod | wc

(where nopod strips out all pod)

Now as for performance. Its a killer:

Benchmark: timing 1000 iterations of ghttp, lite...
     ghttp:  7 wallclock secs ( 0.79 usr +  0.79 sys =  1.58 CPU)
      lite: 21 wallclock secs ( 6.86 usr +  2.83 sys =  9.69 CPU)

(I had to fix a bug in the code, so I'll put a new one on CPAN tomorrow -
its always fun how often running benchmarks reveal bugs!)

Let me know if you want the benchmark source code.

-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to