Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#194 [attachment_tnef] inefficient processing of rtf parts

open
nobody
None
5
2008-02-22
2008-02-22
Tomas Kuliavas
No

When attachment_tnef 0.7 plugin processes compressed rtf parts in TnefFileRTF::uncompress_rtf, it stores processed data in array. One array key for one byte. It is highly inefficient way of generating data that eventually is converted to string with implode(). If winmail.dat has 5.7 MB rtf part, peak memory usage is over 300 MB even when PHP caching is used.

Peak memory usage before "$result = $attachment->decodeTnef($tnef);" call is only 20 MB and it already includes 17 MB taken by tnef message body loaded into memory.

Discussion