6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
7/27/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#10949] RFC822 parsing library very inefficient
*
Your Email Address
*
Spam protection
Enter the letters below:
. .. ..___.__ . . \ /|\/|[__ | \|\/| \/ | |[___|__/| |
Comment
> Changes have been made in Git (refs/heads/master): > > commit 90462df31f5ec31200a1ed9144f6569e3a203d33 > Author: Michael M Slusarz <slusarz@horde.org> > Date: Sun Jan 29 21:04:06 2012 -0700 > > [mms] Improved parser for e-mail addresses (Request #10949). > > The previous parsing method involved splitting at "important" RFC 822 > characters (e.g. < . :) and then brute-forcing to see if this was the > correct decision. New code goes through the string linearly, checking > the grammar against the ABNF contained in the RFC. > > Performance statistics: On a message with 50 e-mail addresses, > performance was 20x faster. Within the script itself, total cumulative > time within the parseAddressList() method went from 92% -> 7%. > > Real performance numbers are probably not quite this great. The new > library substnatially reduces recursion. Methods relying on recursion > are artifically slowed down by xdebug since each function call has a > more significant performance penalty than under regular PHP since > xdebug needs to record data about each call. Even factoring this in, > the new code is a substantial performance improvement - for messages > containing substantial numbers of e-mail addresses (> 30), the limiting > bottleneck was previously Rfc822 address parsing. This should no longer > be the case. > > framework/Mail/lib/Horde/Mail/Rfc822.php | 1026 > +++++++++------------- > framework/Mail/lib/Horde/Mail/Rfc822/Address.php | 74 ++ > framework/Mail/lib/Horde/Mail/Rfc822/Group.php | 40 + > framework/Mail/package.xml | 24 +- > framework/Mail/test/Horde/Mail/ParseTest.php | 59 +- > 5 files changed, 601 insertions(+), 622 deletions(-) > > http://git.horde.org/horde-git/-/commit/90462df31f5ec31200a1ed9144f6569e3a203d33
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers