cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libCurl taking long time to download

From: Guenter <lists_at_gknw.net>
Date: Thu, 03 Sep 2009 21:47:02 +0200

Hi Sandeep,
Sandeep R M schrieb:
> I have had very good experience using libCurl for downloading files
> using FTP (it downloaded files atleast 2.5 seconds faster than wget).
>
> Now, I am trying to download files using http, to my surprise, I see
> libCurl performing much slower than python's httplib, url2lib and even
> wget. Below are the timing details for downloading
> http://curl.haxx.se/download/curl-7.19.6.tar.gz, 50 times on Solaris
> machine, timing details have been obtained using *time* command,
>
> Python's urllib2 - real 0m27.29s, user 0m1.11s, sys 0m1.35s
>
> Python's httplib - real 0m21.19s, user 0m0.80s, sys 0m1.23s
>
> libCurl - real 5m18.91s, user 0m0.60s, sys 0m1.99s
>
> curl - real 5m43.95s, user 0m0.45s, sys 0m1.93s
>
> wget - real 0m19.25s, user 0m0.00s, sys 0m1.79s
>
> I am aware that for general computation of speed only user time + sys
> time is considered. But consistently if the application takes so much
> time, how efficient and fast is it? (5 minutes and 43 seconds for
> libcurl comapred to 21 seconds for httplib)
I've just tested on SuSE Linux 10.3 with curl 7.19.4, and cant see such
bad performance:
# time curl -O http://curl.haxx.se/download/curl-7.19.6.tar.gz
  % Total % Received % Xferd Average Speed Time Time Time
Current
                                 Dload Upload Total Spent Left
Speed
100 2931k 100 2931k 0 0 229k 0 0:00:12 0:00:12 --:--:--
 191k

real 0m12.807s
user 0m0.056s
sys 0m0.196s

# time curl -O http://curl.haxx.se/download/curl-7.19.6.tar.gz
  % Total % Received % Xferd Average Speed Time Time Time
Current
                                 Dload Upload Total Spent Left
Speed
100 2931k 100 2931k 0 0 182k 0 0:00:16 0:00:16 --:--:--
 216k

real 0m16.114s
user 0m0.056s
sys 0m0.144s

# time curl -O http://curl.haxx.se/download/curl-7.19.6.tar.gz
  % Total % Received % Xferd Average Speed Time Time Time
Current
                                 Dload Upload Total Spent Left
Speed
100 2931k 100 2931k 0 0 169k 0 0:00:17 0:00:17 --:--:--
 250k

real 0m17.317s
user 0m0.036s
sys 0m0.180s

# time curl -O http://curl.haxx.se/download/curl-7.19.6.tar.gz
  % Total % Received % Xferd Average Speed Time Time Time
Current
                                 Dload Upload Total Spent Left
Speed
100 2931k 100 2931k 0 0 242k 0 0:00:12 0:00:12 --:--:--
 232k

real 0m12.093s
user 0m0.076s
sys 0m0.132s

tests with wget gave ~same results. So I assume that perhaps something
in the code is problematic with Solaris ...
I'll ask a friend who works on different Solaris versions and report
back what he says ...

Günter.
Received on 2009-09-03