cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

RE: libcurl 4 times slower than wget

From: Liu Shan Shui <me_at_lx.sg>
Date: Tue, 12 May 2009 05:11:04 +0800

Hi Yaris,

 

I found your post on WHT while Googling. Next time, if you've posted your
question elsewhere, include the links to them here for contextual purposes.
And when comparing cURL with Wget or any other data retriever, do post the
code you've used for benchmarking as well.

http://www.webhostingtalk.com/showthread.php?p=6176557

 

I don't think it's a IP4/6 issue, but rather what was mentioned earlier in
the WHT thread about Wget being able to process multiple requests at a time.
For that, you may want to check out the curl_multi_exec() function:
http://www.rustyrazorblade.com/2008/02/20/curl_multi_exec/

 

And my advice to you is, just go with whichever you prefer of the two - both
are great tools for retrieving content. For me, I would use cURL because:

1. I'm familiar with using it already.

2. It has features which I sometimes need and not available on Wget. Read:
http://daniel.haxx.se/docs/curl-vs-wget.html

3. It's simpler to use, even though you may have mentioned that it may not
match up to Wget in terms of performance. But to me, developer time is more
expensive than processor time, so most of the time it would make more
economic sense to choose cURL over Wget. But of course, if application speed
is your utmost priority, then maybe Wget would be a better choice for you.

4. I've even wrote a cURL wrapper class in PHP 5 to further simplify its
usage, especially for POSTing. Read: http://code.google.com/p/curlx/

 

With regards,

Liu Shan Shui

me_at_lx.sg

"Life would be much easier if I had the source code." - Anonymous

 

From: curl-and-php-bounces_at_cool.haxx.se
[mailto:curl-and-php-bounces_at_cool.haxx.se] On Behalf Of yaris dong
Sent: Tuesday, May 12, 2009 4:31 AM
To: curl-and-php_at_cool.haxx.se
Subject: libcurl 4 times slower than wget

 

Hi doing basic test, downlaoding 1000 pages, wget finishes at least 4 times
faster than downlaoding through libcurl.

the download speed is exactly same....however libcurl is slower...

my suspicion is something to do with establishing connections. how can i
configure it to do IP v4 instead of v6? i've heard this is the root of the
cause for such scenarios.

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2009-05-11