Performance issue due to $&
"Todd Richmond" <[email protected]> Wed, 19 Jan 2005 18:02:13 -0800
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Message-ID | <001d01c4fe94$0f65ef10$0200a8c0@viper> |
I was looking through a coworker's regex book and the Perl chapter has
section on performance problems caused by $&. If $& or $` are used by any
module whatsoever, all perl regex matches in the entire program make an
extra copy of the string regardless of whether it is needed or not. This
causes a severe, but hidden performance penalty that is up to 5x for simple
regexes that I verified and which was caused by Message::Head::Complete.
This is particularly painful for Mail::Box because it manipulates large
RFC822 message text
Can you replace $& in Message::Head::Complete,
Message::TransferEnc::SevenBit, IMAPClient::Thread and
IMAPClient::BodyStructure::Parse. It should help some performance and memory
issues that people have noticed
Thanks,
Todd