curl-library
Aw: Re: Re: DNS Lookup time (CURLINFO_NAMELOOKUP_TIME) performs worse than getaddrinfo()
From: Bernhard Jaeger <B.Jaeger1_at_gmx.net>
Date: Tue, 26 Jun 2018 17:15:36 +0200
Date: Tue, 26 Jun 2018 17:15:36 +0200
Thank you for your answer it helped me fix the problem.
I got the same results as you did with the pull request the initialisations were around 50 microseconds hence negligible.
You can close the pull request.
What made the performance difference was the threaded resolver.
After configuring (and building) curl with the --disable-threaded-resolver option I got the correct performance (~1 ms without threaded resolver, ~4ms with threaded resolver)
This solves my problem but I would still be interested to find out why the threaded resolver performs worse, usually threading is used to increase performance.
-- Bernhard Jaeger
Gesendet: Montag, 25. Juni 2018 um 23:15 Uhr
Von: "Daniel Stenberg" <daniel@haxx.se>
An: "libcurl development" <curl-library@cool.haxx.se>
Betreff: Re: Aw: Re: DNS Lookup time (CURLINFO_NAMELOOKUP_TIME) performs worse than getaddrinfo()
Von: "Daniel Stenberg" <daniel@haxx.se>
An: "libcurl development" <curl-library@cool.haxx.se>
Betreff: Re: Aw: Re: DNS Lookup time (CURLINFO_NAMELOOKUP_TIME) performs worse than getaddrinfo()
On Mon, 25 Jun 2018, Bernhard Jaeger wrote:
> But this data are from two different programs so it would be very helpful to
> have an additional timestamp within licurl to see if the initialisations are
> what really makes the difference here. Would it be possible to have that
> feature on a new branch?
I created a PR at https://github.com/curl/curl/pull/2683 with such an
additional time-stamp, but in my tests that time-stamp tends to be in the sub
100 microsecond range...
$ ./src/curl -sw '%{time_namelookup_start} %{time_namelookup}\n' https://www.haxx.se -o /dev/null
0.000072 0.004239
> Unfortunately I don't know what the threaded resolver backend is.
curl can be built to use one of three different ways to resolve host names:
1. the threaded resolver (runs getaddrinfo in a separate thread) - default
2. the synchronous name resolver (using getaddrinfo directly)
3. c-ares
--
/ daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
> But this data are from two different programs so it would be very helpful to
> have an additional timestamp within licurl to see if the initialisations are
> what really makes the difference here. Would it be possible to have that
> feature on a new branch?
I created a PR at https://github.com/curl/curl/pull/2683 with such an
additional time-stamp, but in my tests that time-stamp tends to be in the sub
100 microsecond range...
$ ./src/curl -sw '%{time_namelookup_start} %{time_namelookup}\n' https://www.haxx.se -o /dev/null
0.000072 0.004239
> Unfortunately I don't know what the threaded resolver backend is.
curl can be built to use one of three different ways to resolve host names:
1. the threaded resolver (runs getaddrinfo in a separate thread) - default
2. the synchronous name resolver (using getaddrinfo directly)
3. c-ares
--
/ daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-06-26