cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl slower than winxp IE, anyone help me?

From: ̼ <millerfor_at_gmail.com>
Date: Wed, 7 Jan 2009 17:33:09 +0800

Hi, all. I am new in libcurl, and add libcurl to my new vc6 project, which
is an auto-download http-file app.

what I do is:
1. built libcurl 7.18.2 release-dll-ssl-dll
2. built in libcurl to my project setting and invoke curl api as follows:
    curl_handle = curl_easy_init();
    curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemory);
    curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, HttpHeaderData);
    curl_easy_setopt(curl_handle, CURLOPT_USERAGENT,
LPCTSTR(settings.m_UserAgent));
    curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1);
    curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 10);
    curl_easy_setopt(curl_handle, CURLOPT_SSLENGINE_DEFAULT, 1);
    curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0);
    curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0);
    curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1);
    curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1);
    curl_easy_setopt(curl_handle, CURLOPT_URL, url);
    curl_easy_setopt(curl_handle, CURLOPT_FILE, static_cast<void *>(&data));
    curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER, static_cast<void
*>(&data));
    curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl_handle, CURLOPT_HTTPGET, 1);
    result = curl_easy_perform(curl_handle);

Then I test my app by download a file throught HTTP, which do not support
resume broken download. What I got is that, libcurl usually return "HTTP GET
failed. CURL error: Transferred a partial file (18)", although it still
download file for me.

I log time in my app, and compare libcurl speed with winxp IE7 by
downloading the same 3.27M file, libcurl lasting 8 minutes, but IE7 only
need less than 4 minutes.

My app is multi-thread, but my testing only invoke one thread.

Does anyone give me some help to speed up libcurl? Thanks a lot!

BTW. I notice a previous mail:
http://curl.haxx.se/mail/lib-2002-12/0041.html talked about the same
question in Mac, and solved by ./configure --disable-ipv6. But I check
my Makefile.vc6 and config-win32.h, they does not include ENABLE_IPV6 flag.
Received on 2009-01-07