curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Time taken by curl_easy_perform

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sun, 1 Oct 2017 12:02:54 +0200

On Sun, Oct 01, 2017 at 11:20:02AM +0530, Vidyanand Nille via curl-library wrote:
> I am using curl 7.29 on RHEL 7.1.
>
> When I tried hitting URL with curl command it's taking 10ms to get complete
> response but same URL when fetched from curl_easy_perform function it's taking
> 50ms to get response.
>
> I tried it multiple times but there is consistent difference of 35-40 ms
> between curl command and libcurl function.
>
> When debugged further, through curl_easy_perform I am getting response header
> in 10ms but response data is coming after 30ms difference always. Behavior is
> consistent. What could be reason?

Well, curl uses libcurl internally, too, so it's probably due to the transfer
being set up differently. Did you make sure your program is using the same
libcurl as the curl front-end (e.g., it's not picking up another version in
/usr/local/lib by mistake)? You can use the --libcurl option (if it's
available in that old curl version) to see what options are being set by curl
for the transfer and try to do exactly the same options in your program. How
are you measuring the transfer times? Make sure you're not accidentally
measuring program startup time in addition to the transfer itself. Have you
tried using the logging options to narrow where the time is being spent in your
program? Have you tried using the curl_easy_getinfo options to log the time
spent in various phases?

>>> Dan
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-10-01