Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by Juerd (Abbot)
on Feb 24, 2004 at 18:49 UTC ( [id://331483]=note: print w/replies, xml ) Need Help??


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

How about LWP::Simple's get? (And I'd like some cmpthese instead of timethese, because I like percentages.)

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: First impressions of WWW::Curl::Lite
by sri (Vicar) on Feb 25, 2004 at 00:32 UTC
    Yes, LWP::Simple is much faster than LWP::UserAgent.

    #!/usr/bin/perl -w use strict; use Benchmark qw(:all); use lib 'src/WWW-Curl-Lite/lib'; use WWW::Curl::Lite::Request; use WWW::Curl::Lite; use LWP::Simple; use LWP::Parallel::UserAgent; use HTTP::Request; use HTTP::MHTTP; my $request = new WWW::Curl::Lite::Request( { url => 'http://127.0.0.1 +' } ); my $curl = new WWW::Curl::Lite; my $pua = new LWP::Parallel::UserAgent; my $req = new HTTP::Request( GET => 'http://127.0.0.1' ); cmpthese( 100, { 'curl' => sub { for ( 1 .. 10 ) { $curl->register($request) } $curl->request; }, 'lwp' => sub { for ( 1 .. 10 ) { get('http://127.0.0.1') } }, 'lwp-parallel' => sub { $pua->initialize; $pua->nonblock(1); for ( 1 .. 10 ) { $pua->register($req) } $pua->wait; }, 'mhttp' => sub { for ( 1 .. 10 ) { http_init(); http_call( "GET", "http://127.0.0.1" ); http_response(); } } } );
    Rate lwp-parallel lwp curl mhtt +p lwp-parallel 9.07/s -- -78% -89% -96 +% lwp 41.3/s 355% -- -50% -81 +% curl 83.3/s 818% 102% -- -62 +% mhttp 217/s 2296% 426% 161% - +-

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-29 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found