curl-library
Re: CURLOPT_READFUNCTION performance issue
Date: Thu, 25 Jul 2013 23:50:55 +0200 (CEST)
On Thu, 25 Jul 2013, Michael Dowling wrote:
(Please don't top-post)
> Thanks again for the test script. I was able to reproduce the performance
> issue by simply pointing the test script you provided to a simple web server
> that runs on node.js (change the URL in the test script to
> "http://localhost:8124").
Ack. So did I, but I decided to just run it against my local Apache
installation on my dev box (a core-i7, running linux 3.10).
Attached is my modified test program that shows the additional delay that
happens in the callback case. It switches on verbose mode and a custom debug
function output that displays the delta time since the previous output:
"D(time)". Time in microseconds.
Also attached are two log files from my tests:
1- log-500 shows the first 500 logged lines of the non-callback run
2- log2-500 shows the first 500 logged lines of the callback version's run
In the second log, on line 27 the first HTTP data of the response is received
from the server 98 microseconds after the data was sent in the first request.
However, at line 75 we can see the second HTTP response being received 36817
microseconds after the data was sent! Going down the log we can see that
all subsequent responses show this exessive time.
Comparing with the first log, we can see on line 28, 77, 126, 175 etc that the
timing is there on average about 40 microseconds for the first line of the
response to have been received.
I can also confirm these numbers when stracing the problematic version. Now
I'm diving into why this is happening and what I can do about it...
-- / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html