curl-library
Re: raise chunks of memory in callback
Date: Tue, 22 Mar 2011 11:37:37 +0100
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
Received on 2011-03-22