Re: [PHP-DEV] Re: [PATCH] imap_savebody()

2005-09-26 Thread Wez Furlong
I'd recommend adopting Sara's suggestion; those memset()s you have there shouldn't be needed: char buf[GETS_FETCH_SIZE]; while (ret > 0) { if (!f(stream, sizeof(buf), buf)) break; php_stream_write_string(IMAPG(gets_stream), buf); } return NULL; --Wez. On 9/26/05, Michael Wallner <[

Re: [PHP-DEV] Re: [PATCH] imap_savebody()

2005-09-23 Thread Andi Gutmans
Yep, I agree with that, and some past tests of mine showed that depending on the system, anything bigger than about 8-64K, will give marginal performance increase (and possibly decrease depending on memory allocation); so it's really not worth the hassle. It's also a size which we can allocate

Re: [PHP-DEV] Re: [PATCH] imap_savebody()

2005-09-22 Thread Wez Furlong
Use 8192 chunk size; anything bigger than that is a complete waste of memory. --Wez. On 9/22/05, Ilia Alshanetsky <[EMAIL PROTECTED]> wrote: > Sara Golemon wrote: > >>#define GETS_FETCH_SIZE 2048000 > >> > > > > That size doesn't seem a bit excessive to you? I thought the whole point of > > dump

Re: [PHP-DEV] Re: [PATCH] imap_savebody()

2005-09-22 Thread Ilia Alshanetsky
Sara Golemon wrote: >>#define GETS_FETCH_SIZE 2048000 >> > > That size doesn't seem a bit excessive to you? I thought the whole point of > dumping it to a file was to avoid huge memory chunks. Not to mention the > fact that reserving 2MB of stack space makes me a little twitchy... Indeed, 2 meg