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

curl-and-php

difference in timing btwn curl and curl_multi in php

From: Sri Rao <sri_at_cloudflare.com>
Date: Sat, 11 Sep 2010 19:37:00 -0700

Hi,

I am writing a script to pull a page and then parse the page and then
retrieve all the items on the page like images and css and such. This
is to time the performance of sites. In order to make the process
more efficient I went from a serial download to using curl_multi.
Doing that I noticed that the individual GETs were slower than when I
did that same curl serially.

I chopped up the script and posting it here as an example. It prints
out debug lines but it also prints at the very end performance numbers
btwn using the curl interface vs the curl_multi. As you can see there
starttransfer_time is significantly bigger. It is a combination of
pretransfer_time but not sure why it would be that much higher than
doing it serially.

The timing I have here is from hitting google's frontpage:

file stime mstime
 ptime mptime ctime mctime
/intl/en_ALL/images/srpr/logo1w.png 0.124099 1.001613
 0.049408 0.501164 0.049404 0.501119
/images/icons/hpcg/ribbon_us-a_42.png 0.126453 1.001137
 0.050009 0.50075 0.050005 0.500746

stime = starttransfer_time
ptime = pretransfer_time
ctime = connect_time

I checked running this on mac osx(10.6.4) (php(5.3.1), libcurl
7.19.7), ubuntu(10.4) (5.3.3,7.16.2), ubuntu(10.4) (5.3.3,
7.21.1(manually compiled))

Thanks for your help.

sri

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

Received on 2010-09-12