cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: help: libCURL with epoll

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 22 Nov 2011 23:48:26 +0100 (CET)

On Tue, 22 Nov 2011, Robert Bandl wrote:

> Actually it is, on my machine, when curl is built without c-ares,
> curl_easy_init() takes on average 60 microseconds. When using c-ares it's
> about 1100 microseconds for me

1100 microseonds of a single request is an issue? I don't really consider that
"very slow" even if I understand other resolvers don't have that startup time.

> (i.e. easy handles don't share ares resolver through multi handle, dunno
> whether that's because it's not possible for some reason or you guys simply
> didn't have time)

I figure it should be possible indeed. I don't think anyone before has
considered a millisecond per request to be that big deal so its not been on
anyones fixlist. Feel free to give it shot!

A slight variation of that, which would be even easier, would be to share just
the c-ares "config" so that it would be prevented from reading files from disk
etc in each subsequent init. That'd require a slightly modified c-ares I
believe.

> I thought it's fairly safe to assume that performance of easy handle
> initialization is more or less the same.

That's not really how I read the previous statement I commented on, but yes, I
would think the "long" time spent when the c-ares resolver is inited is taken
by c-ares itself so it doesn't matter how we change libcurl as long as the
initing is done like this.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-11-22