[imp] message cache performance / parseAddressList

Matthew Dunham matthew.dunham at ic.ucsb.edu
Fri Aug 15 21:17:29 UTC 2008


>> Folks -
>>
>> So I'm looking at cache performance in 4.2.1RC1. Once I've logged in  
>> and my mailbox cache has been populated, I still see  
>> IMP_UI_Mailbox->getFrom spending running parseAddressList every time  
>> I refresh a mailbox page.
>>
>> It looks like the PEAR Mail_RFC822 parser is just doing a buncha  
>> address validation, but it's rather expensive performance-wise Is  
>> there any reason the getFrom stuff isn't cached? Can it be?
> 
> OK, playing around with Xdebug a bit, I do see that this processing  
> took up a fair amount of time.  In a DIMP mailbox with 91 messages,  
> for example, this processing took 73ms out of a total of 411ms  
> cumulative time - almost 18% of processing time.  This is definitely  
> something that would be very useful to cache.  Luckily, for our  
> purposes, it is fairly trivial to implement.  Since we only use  
> getFrom() when building mailbox lists, and these mailbox lists are  
> built via buildMailboxArray(), and buildMailboxArray() is only called  
> from these locations, we can add getfrom information to the return  
> from that function.  This also makes the change easily BC for  
> dimp/mimp.  I've made the changes to the latest HEAD and FW_3 versions.
> 

Thanks Michael - nice fix.

To open the worm can just a smidge more, Xdebug shows a similar (albeit 
smaller) performance hit in IMP_Headers->getOb when viewing individual 
messages. It would be great if the To/CC/Bcc addresses displayed by 
message.php were run through the RFC822 validation routines only once 
and then cached, rather than having each address revalidated every time 
a message is viewed. Ought to result in a somewhat snappier message UI.

-- 
|||||||||||  Matthew E. Dunham
|||||  Instructional Computing
||||||||||||  UC Santa Barbara
||||||||||||||||  805 893 7687


More information about the imp mailing list