Awhile back, it was reported that MHonArc's execution speed has slowed
in releases after v2.0b3, and the initial stated culprit was the gzip
support and how symbolic filehandles were being used.
However, that is not the case. First, symbolic filehandles were always
used in the various file reading functions so it would be inconsistent
if the gzip support would cause a significant slowdown (plus I tested
it). I then noticed that execution seemed to be slower only in the
reading of the messages (ie. file writing seem to be about the same).
Well after doing diffs on the latest version and v2.0b3, I still could
not figure it out (note: the diffs actually did show the difference
that caused to slow down, but there was so much diff data, it was too
much to figure out manually).
Well, I decided to check out the ol' Perl FAQ to see of there were some
performance analyzers. And there is! Devel::DProf. I got it and
tried it out (had problems with the version of Perl at my workplace,
but UCI worked enough to highlight the problem). The problem is the
iso_8859'str2sgml routine. After v2.0b3, iso_8859'str2sgml was used as
the charset filter for plain and us-ascii text to replace the bug in
the convert_line routine (iso_8859'str2sgml was used for the iso-8859-*
charsets in v2.0b3, but iso_8859'str2sgml would only be called in rfc
1522 encoded text). Hence iso_8859'str2sgml was called tons of times
(via the MAILdecode_1522_str() routine) when processing converting
messager header fields since most message header data is not charset
encoded (i.e. the "plain" filter is called alot).
iso_8859'str2sgml is not very efficient due to the nature of what it
does. Hence, for the next release, I will make the "htmlize", or
something similiar, routine the default routine for plain and
If you want the better performance now, just add the following in your
BTW, the performance increase does not pay off unless you are
processing a lot of messages at one time. Doing single message adds
may not show much improvement, but it could be enough depending on your