cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH RFC] hyper/multi-socket API optimization

From: Robert Iakobashvili <coroberti_at_gmail.com>
Date: Tue, 10 Apr 2007 20:31:22 +0200

>
> Can you also
> please provide a patch for the man page for this new function?

OK. Which exactly files with docs to be updated?

> +#define CSELECT_IN 0x01
> > +#define CSELECT_OUT 0x02
> > +#define CSELECT_ERR 0x04
> Please modify these to get a CURL_ prefix to stay within our scope.

OK.

call it curl_multi_socket_action() ?

OK.

> - Where to keep the bitmask: in SessionHandle or better in UserDefined?
> Shouldn't it be located in the connectdata struct? If it should be in the
> SessionHandle struct, it probably belongs in the 'UrlState' sub-struct.

OK. I will try to put to connectdata object.

> - Does it makes sense to have a flag and not to scan for all splay timers
> in
> > multi_socket () every time, when calling e.g.
> curl_multi_socket_noselect() ?
>
It doesn't really "scan for all", in the vast majority of all invokes it'll
> detect that the root node has time left until expiry so it'll stop there.

OK.

> 1. A registered socket callback is called by libcurl on a connected handle
> > after the state DONE. Thus, the hipev.c example registeres fd with
> libevent
> > only for data read/write actions. Can it be done earlier just after
> > non-blocking connect () in order to make more usage of epoll() and less
> of
> > poll ()?
>
> Yes sure, it certainly can be made to.

Good. I will try to do it later.

> 2. There is a huge number of gettimeofday() calls originating from
> libcurl.
> > What are the directions to decrease the numbers somehow?
>
> If we can figure out a way to perhaps make one call at an earlier place
> and
> re-use the timevalue after that, we should be able to reduce some calls.
>
> Oh, perhaps not totally unimportant: I would like to apply this work after
> the
> upcoming 7.16.2 release, which I should be able to ship "any day now"...

Indeed. It is a more general and standalone issue. Still, fifty calls of
gettimeofday () for 9 chunks of data - is worth looking at.

Looking forward to the next release. Actually, curl-loader is due to provide
loading framework, which is now HTTP/S, FTP/S and later may be extended
to support ssh, scp and sftp new-comers.

-- 
Sincerely,
Robert Iakobashvili,
coroberti %x40 gmail %x2e com
...................................................................
Navigare necesse est, vivere non est necesse
...................................................................
Received on 2007-04-10