cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Improving libcurl performance

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 14 Jun 2002 14:03:17 +0200 (MET DST)

On 14 Jun 2002, yarram sunil wrote:

> I am using curl-7.9.7 on windows. I was testing the throughput of curl
> by repeatedly fetching a particular page from local LAN. I have used
> Rational Quantify tool and found out that significant part of time is spent
> in "SocketIsDead" function defined in file "url.c". In this function
> "select" is used with a timeout value of 1 micro second.

I find it mildly amusing that waiting 1 *microsecond* turns out to be a
"significant part"... Can't but to smile at that! ;-)

> When i changed the timeout value to 0 seconds throughput increased rapidly.
> By changing the timeout value from 1 microsecond to 0 seconds am i doing
> anything wrong? are there any reason for it to be 1 microsecond. The
> function "SocketIsDead" is used only to check whether a socket is dead or
> alive and i am able to do this with 0 second timeout.

Thinking about it, I believe you are totally right. A 0 second timeout should
also serve the same purpose.

Thanks for the excellent digging!

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
Received on 2002-06-14