osdir.com
mailing list archive

Subject: [SACVS] CVS: spamassassin/lib/Mail/SpamAssassin PerMsgStatus.pm,1.233,1.234 - msg#00355

List: mail.spam.spamassassin.cvs

Date: Prev Next Index Thread: Prev Next Index
Update of /cvsroot/spamassassin/spamassassin/lib/Mail/SpamAssassin
In directory sc8-pr-cvs1:/tmp/cvs-serv30555/lib/Mail/SpamAssassin

Modified Files:
PerMsgStatus.pm
Log Message:
minor speed-up (0.6% lower mass-check time) in mk_param()


Index: PerMsgStatus.pm
===================================================================
RCS file:
/cvsroot/spamassassin/spamassassin/lib/Mail/SpamAssassin/PerMsgStatus.pm,v
retrieving revision 1.233
retrieving revision 1.234
diff -b -w -u -d -r1.233 -r1.234
--- PerMsgStatus.pm 27 Dec 2002 03:17:39 -0000 1.233
+++ PerMsgStatus.pm 27 Dec 2002 07:45:07 -0000 1.234
@@ -1965,14 +1965,13 @@

###########################################################################

-
+# note: this is called once for every eval on every message so
+# performance is important
sub mk_param {
my $param = shift;

- my @ret = ();
- while ($param =~ s/^\s*['"](.*?)['"](?:,|)\s*//) {
- push (@ret, $1);
- }
+ # it would be nice if the quotes were optional for numeric arguments
+ my @ret = ($param =~ m/['"](.*?)['"]\s*(?:,\s*|$)/g);
return @ret;
}




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf


Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

[SACVS] CVS: spamassassin/lib/Mail/SpamAssassin NoMailAudit.pm,1.43,1.44

Update of /cvsroot/spamassassin/spamassassin/lib/Mail/SpamAssassin In directory sc8-pr-cvs1:/tmp/cvs-serv12861/lib/Mail/SpamAssassin Modified Files: NoMailAudit.pm Log Message: make mass-check 1.85% faster by using lc($_) eq lc($foo) instead of /^$foo$/i in _get_header_list() which we do about 90 times per message Index: NoMailAudit.pm =================================================================== RCS file: /cvsroot/spamassassin/spamassassin/lib/Mail/SpamAssassin/NoMailAudit.pm,v retrieving revision 1.43 retrieving revision 1.44 diff -b -w -u -d -r1.43 -r1.44 --- NoMailAudit.pm 23 Dec 2002 13:40:47 -0000 1.43 +++ NoMailAudit.pm 27 Dec 2002 03:19:36 -0000 1.44 @@ -156,7 +156,7 @@ my ($self, $hdr) = @_; # OK, we want to do a case-insensitive match here on the header name # So, first I'm going to pick up an array of the actual capitalizations used: - my @cap_hdrs = grep(/^$hdr$/i, keys(%{$self->{headers}})); + my @cap_hdrs = grep(lc($_) eq lc($hdr), keys(%{$self->{headers}})); # And now pick up all the entries into a list my @entries = map($self->{headers}->{$_},@cap_hdrs); ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf

Next Message by Date: click to view message preview

[SACVS] CVS: spamassassin/rules 20_head_tests.cf,1.222,1.223 70_cvs_rules_under_test.cf,1.314,1.315

Update of /cvsroot/spamassassin/spamassassin/rules In directory sc8-pr-cvs1:/tmp/cvs-serv453/rules Modified Files: 20_head_tests.cf 70_cvs_rules_under_test.cf Log Message: replace SUSPICIOUS_RECIPS and VERY_SUSP_RECIPS with new rules promote SORTED_RECIPS rule Index: 20_head_tests.cf =================================================================== RCS file: /cvsroot/spamassassin/spamassassin/rules/20_head_tests.cf,v retrieving revision 1.222 retrieving revision 1.223 diff -b -w -u -d -r1.222 -r1.223 --- 20_head_tests.cf 26 Dec 2002 11:52:48 -0000 1.222 +++ 20_head_tests.cf 27 Dec 2002 07:59:10 -0000 1.223 @@ -478,11 +478,14 @@ header MISSING_HEADERS eval:check_for_missing_to_header() describe MISSING_HEADERS Missing To: header -header SUSPICIOUS_RECIPS ToCc =~ /(@[-a-z0-9_.]{2,}).*(?:\1.*){8,}/is -describe SUSPICIOUS_RECIPS To: and Cc: contain similar domains at least 8 times +header SUSPICIOUS_RECIPS eval:similar_recipients('0.6','1.2') +describe SUSPICIOUS_RECIPS Similar addresses in recipient list -header VERY_SUSP_RECIPS ToCc =~ /\b([a-z][a-z])[^@,<>\(\) ]{0,20}(@[-a-z0-9_\.]{3}).{0,80}?(?:\1[^@,<>\(\) ]{0,20}\2.{0,80}?){5,}/is -describe VERY_SUSP_RECIPS To: and Cc: contain similar usernames at least 5 times +header VERY_SUSP_RECIPS eval:similar_recipients('1.2','undef') +describe VERY_SUSP_RECIPS Very similar addresses in recipient list + +header SORTED_RECIPS eval:sorted_recipients() +describe SORTED_RECIPS Recipient list is sorted by address header USER_IN_WHITELIST_TO eval:check_to_in_whitelist() describe USER_IN_WHITELIST_TO User is listed in 'whitelist_to' Index: 70_cvs_rules_under_test.cf =================================================================== RCS file: /cvsroot/spamassassin/spamassassin/rules/70_cvs_rules_under_test.cf,v retrieving revision 1.314 retrieving revision 1.315 diff -b -w -u -d -r1.314 -r1.315 --- 70_cvs_rules_under_test.cf 26 Dec 2002 21:06:24 -0000 1.314 +++ 70_cvs_rules_under_test.cf 27 Dec 2002 07:59:10 -0000 1.315 @@ -124,18 +124,6 @@ ######################################################################## -# bug 1308 -# only two rules are needed to effectively subdivide the range -header T_SUSPICIOUS_RECIPS eval:similar_recipients('0.6','1.2') -header T_VERY_SUSP_RECIPS eval:similar_recipients('1.2','undef') -describe T_SUSPICIOUS_RECIPS Similar addresses in recipient list -describe T_VERY_SUSP_RECIPS Very similar addresses in recipient list -# another rule based on same idea -header T_SORTED_RECIPS eval:sorted_recipients() -describe T_SORTED_RECIPS Recipient list is sorted by address - -######################################################################## - # more work on slow rules, mostly adding \b, but with one or two other # performance improvement attempts, total speed-up if all of these are # applied is 2.0% ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf

Previous Message by Thread: click to view message preview

[SACVS] CVS: spamassassin/lib/Mail/SpamAssassin NoMailAudit.pm,1.43,1.44

Update of /cvsroot/spamassassin/spamassassin/lib/Mail/SpamAssassin In directory sc8-pr-cvs1:/tmp/cvs-serv12861/lib/Mail/SpamAssassin Modified Files: NoMailAudit.pm Log Message: make mass-check 1.85% faster by using lc($_) eq lc($foo) instead of /^$foo$/i in _get_header_list() which we do about 90 times per message Index: NoMailAudit.pm =================================================================== RCS file: /cvsroot/spamassassin/spamassassin/lib/Mail/SpamAssassin/NoMailAudit.pm,v retrieving revision 1.43 retrieving revision 1.44 diff -b -w -u -d -r1.43 -r1.44 --- NoMailAudit.pm 23 Dec 2002 13:40:47 -0000 1.43 +++ NoMailAudit.pm 27 Dec 2002 03:19:36 -0000 1.44 @@ -156,7 +156,7 @@ my ($self, $hdr) = @_; # OK, we want to do a case-insensitive match here on the header name # So, first I'm going to pick up an array of the actual capitalizations used: - my @cap_hdrs = grep(/^$hdr$/i, keys(%{$self->{headers}})); + my @cap_hdrs = grep(lc($_) eq lc($hdr), keys(%{$self->{headers}})); # And now pick up all the entries into a list my @entries = map($self->{headers}->{$_},@cap_hdrs); ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf

Next Message by Thread: click to view message preview

[SACVS] CVS: spamassassin/rules 20_head_tests.cf,1.222,1.223 70_cvs_rules_under_test.cf,1.314,1.315

Update of /cvsroot/spamassassin/spamassassin/rules In directory sc8-pr-cvs1:/tmp/cvs-serv453/rules Modified Files: 20_head_tests.cf 70_cvs_rules_under_test.cf Log Message: replace SUSPICIOUS_RECIPS and VERY_SUSP_RECIPS with new rules promote SORTED_RECIPS rule Index: 20_head_tests.cf =================================================================== RCS file: /cvsroot/spamassassin/spamassassin/rules/20_head_tests.cf,v retrieving revision 1.222 retrieving revision 1.223 diff -b -w -u -d -r1.222 -r1.223 --- 20_head_tests.cf 26 Dec 2002 11:52:48 -0000 1.222 +++ 20_head_tests.cf 27 Dec 2002 07:59:10 -0000 1.223 @@ -478,11 +478,14 @@ header MISSING_HEADERS eval:check_for_missing_to_header() describe MISSING_HEADERS Missing To: header -header SUSPICIOUS_RECIPS ToCc =~ /(@[-a-z0-9_.]{2,}).*(?:\1.*){8,}/is -describe SUSPICIOUS_RECIPS To: and Cc: contain similar domains at least 8 times +header SUSPICIOUS_RECIPS eval:similar_recipients('0.6','1.2') +describe SUSPICIOUS_RECIPS Similar addresses in recipient list -header VERY_SUSP_RECIPS ToCc =~ /\b([a-z][a-z])[^@,<>\(\) ]{0,20}(@[-a-z0-9_\.]{3}).{0,80}?(?:\1[^@,<>\(\) ]{0,20}\2.{0,80}?){5,}/is -describe VERY_SUSP_RECIPS To: and Cc: contain similar usernames at least 5 times +header VERY_SUSP_RECIPS eval:similar_recipients('1.2','undef') +describe VERY_SUSP_RECIPS Very similar addresses in recipient list + +header SORTED_RECIPS eval:sorted_recipients() +describe SORTED_RECIPS Recipient list is sorted by address header USER_IN_WHITELIST_TO eval:check_to_in_whitelist() describe USER_IN_WHITELIST_TO User is listed in 'whitelist_to' Index: 70_cvs_rules_under_test.cf =================================================================== RCS file: /cvsroot/spamassassin/spamassassin/rules/70_cvs_rules_under_test.cf,v retrieving revision 1.314 retrieving revision 1.315 diff -b -w -u -d -r1.314 -r1.315 --- 70_cvs_rules_under_test.cf 26 Dec 2002 21:06:24 -0000 1.314 +++ 70_cvs_rules_under_test.cf 27 Dec 2002 07:59:10 -0000 1.315 @@ -124,18 +124,6 @@ ######################################################################## -# bug 1308 -# only two rules are needed to effectively subdivide the range -header T_SUSPICIOUS_RECIPS eval:similar_recipients('0.6','1.2') -header T_VERY_SUSP_RECIPS eval:similar_recipients('1.2','undef') -describe T_SUSPICIOUS_RECIPS Similar addresses in recipient list -describe T_VERY_SUSP_RECIPS Very similar addresses in recipient list -# another rule based on same idea -header T_SORTED_RECIPS eval:sorted_recipients() -describe T_SORTED_RECIPS Recipient list is sorted by address - -######################################################################## - # more work on slow rules, mostly adding \b, but with one or two other # performance improvement attempts, total speed-up if all of these are # applied is 2.0% ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by