curl-library
Re: raise chunks of memory in callback
Date: Tue, 22 Mar 2011 16:17:06 +0100
Hi Ben,
I saw that the code that retrieves the image works fine, it was my
paranoia haha.
In the other hand, i don't understand this: "Network I/O is about a factor 10e6
slower than invoking a callback"
Can you explain me it?
And finally, is possible raise the buffer? It's only for more knowledge.
Thanks for answer
2011/3/22 Ben Noordhuis <info_at_bnoordhuis.nl>:
> On Tue, Mar 22, 2011 at 10:06, Oscar Salvador <pyscholeber_at_gmail.com> wrote:
>> My question is that i'm retrieving an image from internet, and i write
>> this image into a memory chunk with WRITEFUNCTION and WRITEDATA. The
>> problem is that libcurl retrieves the image a little slow, because it
>> calls many times the callback function to write the chunk of image
>> into a chunk of memory.
>>
>> Is possible raise this buffer?
>>
>> An example:
>>
>> URL-> [http://www.xxxxxxxxx.com/xxxx/xxx-x.jpg]
>> SIZE-> 1252
>> SIZE-> 2712
>> SIZE-> 7092
>> SIZE-> 8552
>> SIZE-> 11215
>>
>> As you can see, callback functions is called 5 times, and i believe
>> that this is worse for better permormance that if it is called only
>> one once.
>
> Network I/O is about a factor 10e6 slower than invoking a callback so
> I wouldn't worry about it. If you care about performance, you can
> identify the bottlenecks with `gprof`.
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-03-22