cURL / Mailing Lists / curl-library / Single Mail

curl-library

performance question

From: rick vaillancourt <rick_vaillancourt_at_hotmail.com>
Date: Fri, 25 Jan 2002 10:49:54 -0500

Hi all-

I did a very simple performance test of calling the curl lib serially 300
times in a row with the same URL to measure the difference in reusing the
same connection v. calling curl_easy_init & curl_easy_cleanup(curl) after
every execution.

To my surprise it seemed to be consistently faster when reinitialized every
time; on average .17+ secs per call reinitializing every time v. .25+ secs
per call reusing connection.

Seems contrary to the doco, anyone experience this?

Thanks.

-Rick

/////////////// code snippet

[...]
if(reconnectEveryTime){
curl = curl_easy_init();
}
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, buffy );
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeMemoryCallback);
curl_easy_setopt(curl, CURLOPT_FILE, (void *)&chunk);
res = curl_easy_perform(curl);

if(reconnectEveryTime){
  curl_easy_cleanup(curl);
}
}
[...]

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
Received on 2002-01-25