Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re^3: First impressions of WWW::Curl::Lite

by sri (Vicar)
on Feb 16, 2004 at 22:53 UTC ( [id://329474]=note: print w/replies, xml ) Need Help??


in reply to Re^3: First impressions of WWW::Curl::Lite
in thread First impressions of WWW::Curl::Lite

It doesn't really matter...
#!/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->request($httpreq) } }, 'lwp-parallel' => sub { $pua->initialize; $pua->nonblock(1); for ( 1 .. 10 ) { $pua->register($httpreq) } $pua->wait; } } );
Benchmark: timing 100 iterations of curl, lwp, lwp-parallel... curl: 26 wallclock secs ( 1.04 usr + 0.15 sys = 1.19 CPU) @ 84 +.03/s (n=100) lwp: 30 wallclock secs ( 6.86 usr + 0.51 sys = 7.37 CPU) @ 13 +.57/s (n=100) lwp-parallel: 34 wallclock secs (11.07 usr + 0.53 sys = 11.60 CPU) @ + 8.62/s (n=100)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://329474]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-25 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found