cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl performance issues

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 11 Oct 2007 11:03:10 -0700

On Thu, Oct 11, 2007 at 03:38:30PM +0800, Éò¾üêÍ wrote:
> hi,friends:
> I am using the curl lib develop a samll performance tool to send/receive
> soap messages and record the server response time and throughput. From the test
> results, it seems that the curl performance is very wrost compared with another
> package do the same operations.
> maybe, there are some performance tuning tech i do not know. Could y give me
> some ideals?

Are you reusing the same connection for all requests (persistent HTTP),
or does libcurl create a new connection each time? What happens if you
eliminate the call to curl_easy_cleanup and reuse the same handle? Did
you mention what version of libcurl you're using?

> #define BUFFER_LENGTH 1024*1024
[...]
> memset(chunk.buffer,0,BUFFER_LENGTH);

Filling a megabyte of memory for each request is going to waste some time
(orders of magnitude lower than what you're seeing, though). This memset
shouldn't be necessary; if you need the data NUL-terminated, you can do
that in getReply().

> headers = curl_slist_append(headers,"Expect: 100-continue");

I'm not sure if libcurl is smart enough to see that you're setting this
header and change its behaviour accordingly. In any case, you shouldn't
normally have to worry about details like this and just libcurl manage it.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2007-10-11