Re: patch to Mail_Mime
| From: | Alan Knowles | Date: | Sat, 25 Jul 2009 00:31:17 +0000 |
| Subject: | Re: patch to Mail_Mime | ||
| References: | 1 2 3 4 | Groups: | php.pear.qa |
| Request: | Send a blank email to pear-qa+get-5376@lists.php.net to get a copy of this message | ||
Yes it would make quite a bit of difference, the memory used up
allocating the elements in the array (which are distinct, not just
pointers to other strings), is completely saved. The implode version
basically has to allocate twice the amount of memory. (once in the
array, once in the resulting string)
On a large email (with attachment etc. this could be over 10Mb+
difference in memory usage) - quite a bit of memory to be adding and
removing.
String concatination, should pre-allocate extra space anyway, so real
reallocs are less necessary.
Regards
Alan
Daniel O'Connor wrote:
Curiosity hat: Does that actually make a significant measurable difference? (Icanhasbenchmarks?) I know there's a lot of slowness in mail_mime encode under certain circumstances/one of the encoding methods, and every time I got to hunting it down with wincachegrind I couldn't ever quite pin it down (though I have vague memories of nasty regex around the place). implode() vs concat doesn't feel like it would be a massive difference (though I'm probably somewhat wrong) On Fri, Jul 24, 2009 at 12:19 AM, Alan Knowles <mailinglist@akbkhome.com>wrote:Patch is fine - apart from minor CS issues - it just concat's the string inline rather than imploding an array of strings.. Regards Alan