note 59877 deleted from ref.curl by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 19:35:25 +0000 |
| Subject: | note 59877 deleted from ref.curl by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155236@lists.php.net to get a copy of this message | ||
Note Submitter: trucex at gmail
----
I've seen a few people claim things like curl executing 2000 requests per minute (I didn't
believe it, but see godaddy.com in the results below). I've also gotten into 5-6 arguments
about the speed of cURL vs. other alternatives.
To stop the argument once and for all, I've created a script that will test cURL retreiving a
page 50 times and file_get_contents 50 times, on a variety of different URL's.
For simplicity, I have only retreived the page from the remote site and then went on to the next
request. All URL's are using the HTTP protocal; FTP is not tested.
Here are the results of the script on one execution:
Calculating 50 queries to http://www.flickr.com/.
cURL took 9.550734 seconds.
file_get_contents() took 10.878360 seconds.
Calculating 50 queries to http://www.yahoo.com/.
cURL took 4.729566 seconds.
file_get_contents() took 10.443786 seconds.
Calculating 50 queries to http://www.ebay.com/.
cURL took 46.348250 seconds.
file_get_contents() took 52.685604 seconds.
Calculating 50 queries to http://www.godaddy.com/.
cURL took 1.505460 seconds.
file_get_contents() took 37.154304 seconds.
Calculating 50 queries to http://www.php.net/.
cURL took 13.136836 seconds.
file_get_contents() took 17.981879 seconds.
You may test this yourself while the script is up as well. Make a note that the page will take a few
minutes to load completely (add all of the result times above and then some).
http://monitor.trucex.com/curltest.php