cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP PUT performance issues

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 6 Dec 2002 09:16:53 +0100 (MET)

On Thu, 5 Dec 2002, Rick Jones wrote:

> > 1. select() until socket is writable
> > 2. read() data to send (unless data was left from previous round)
> > 3. send() as much as possible, if less than full buffer GOTO 1
> > 4. GOTO 2
>
> Is this code called in situations where it is known that most of the time
> the socket is not already writable? If not, then I'd say go ahead and start
> sending and only select after an incomplete send or EWOULDBLOCK.

Right I do acknowledge that, and that is possibly what it would do if no
other factors were involved. But the function that does the read and send
needs to be separate from the function that does the select(), as this is
used with both the easy interface and the multi interface, and the multi
interface allows the application to do handle the select...

Also, the extra overhead of calling select() first is only on the first call
since after that it would do the calls in the same order anyway.

Thanks for the heads up anyway.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-12-06