Bug 71561 - speed boost by getting rid of $& and $'
Summary: speed boost by getting rid of $& and $'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: spamassassin
Version: 1.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Chip Turner
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-08-15 07:17 UTC by Radu Greab
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-02-21 14:56:58 UTC
Embargoed:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.