in reply to Re: First impressions of WWW::Curl::Lite
in thread First impressions of WWW::Curl::Lite
#!/usr/bin/perl -w use strict; use Benchmark qw(:all); use WWW::Curl::Lite::Request; use WWW::Curl::Lite; use LWP::UserAgent; use LWP::Parallel::UserAgent; use HTTP::Request; my $request = new WWW::Curl::Lite::Request( { url => 'http://127.0.0.1 +' } ); my $curl = new WWW::Curl::Lite; my $ua = new LWP::UserAgent; my $pua = new LWP::Parallel::UserAgent; my $httpreq = new HTTP::Request( GET => 'http://127.0.0.1' ); timethese( 100, { 'curl' => sub { for ( 1 .. 10 ) { $curl->register($request) } $curl->request; }, 'lwp' => sub { for ( 1 .. 10 ) { $ua->get('http://127.0.0.1') } }, 'lwp-parallel' => sub { $pua->initialize; $pua->nonblock(1); for ( 1 .. 10 ) { $pua->register($httpreq) } $pua->wait; } } );
Most suprising is how bad LWP::Parallel performed.sri@odyssey:~$ perl benchmark2.pl Benchmark: timing 100 iterations of curl, lwp, lwp-parallel... curl: 25 wallclock secs ( 1.07 usr + 0.18 sys = 1.25 CPU) @ 80 +.00/s (n=100) lwp: 30 wallclock secs ( 7.12 usr + 0.51 sys = 7.63 CPU) @ 13 +.11/s (n=100) lwp-parallel: 34 wallclock secs (11.07 usr + 0.56 sys = 11.63 CPU) @ + 8.60/s (n=100)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: First impressions of WWW::Curl::Lite
by ajt (Prior) on Feb 16, 2004 at 12:01 UTC | |
by sri (Vicar) on Feb 17, 2004 at 00:00 UTC | |
by Juerd (Abbot) on Feb 24, 2004 at 18:49 UTC | |
by sri (Vicar) on Feb 25, 2004 at 00:32 UTC | |
|
Re^3: First impressions of WWW::Curl::Lite
by Aristotle (Chancellor) on Feb 16, 2004 at 21:55 UTC | |
by sri (Vicar) on Feb 16, 2004 at 22:53 UTC |