Bug 71561

Summary: speed boost by getting rid of $& and $'
Product: [Retired] Red Hat Raw Hide Reporter: Radu Greab <radu>
Component: spamassassinAssignee: Chip Turner <cturner>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-02-21 14:56:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Radu Greab 2002-08-15 07:17:17 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020513

Description of problem:
Due to the use of $& and $' variables, a 1.5 MB test mail message was processed
in about 4000 seconds. After I've got rid of those variables, the mail the
processing time dropped to about 220 seconds.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.Get a large text mail message pass it through /usr/bin/spamassassin and
measure the time.
2.Patch spamassassin and repeat the test.

	

Additional info:

The spamassassin version and release is 2.31-15.

Comment 1 Radu Greab 2002-08-15 07:19:02 UTC
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/spamassassin/spamassassin/lib/Mail/SpamAssassin/PerMsgStatus.pm.diff?r1=1.126&r2=1.127

===================================================================
RCS file: /cvsroot/spamassassin/spamassassin/lib/Mail/SpamAssassin/PerMsgStatus.pm,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -r1.126 -r1.127
--- spamassassin/spamassassin/lib/Mail/SpamAssassin/PerMsgStatus.pm	2002/06/28 16:27:58	1.126
+++ spamassassin/spamassassin/lib/Mail/SpamAssassin/PerMsgStatus.pm	2002/07/01 09:17:14	1.127
@@ -1880,7 +1880,7 @@
   # insert the leftover stuff from last time
   $_ = $leftover . $_;
   # if there are not a multiple of 4 bytes, keep the leftovers for later
-  m/^((....)*)/; $_=$&; $leftover=$';
+  m/^((?:....)*)(.*)/ ; $_ = $1 ; $leftover = $2 ;
   # turn each group of 4 values into 3 bytes
   s/(....)/&b64decodesub($1)/eg;
   # special processing at EOF for last few bytes


Comment 2 Chip Turner 2002-08-15 18:06:57 UTC
thanks, applied, will be in rawhide soon