https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5876
--- Comment #10 from J. Nick Koston <[EMAIL PROTECTED]> 2008-04-08 06:59:39
PST ---
There are some other things that could be done to make this more memory
efficient
perhaps use preset variables, never pass arguments as a hash to got hit
$self->got_hit(q#__BLAH_BLAH#,"BODY: ",ruletype=>"body");
would become
$self->got_hit(q#__REPTO_OVERQUOTE#,$prepend2desc,$body);
Doing some testing this this shows a bit of memory recovery. I just changed
the body/head rules to constants and got back about 32k of ram. I'm thinking
perl is just storing lots of copied of the string "body" and "ruletype" in
memory. I'm not sure how it tried to internally optimize this. I wonder if it
would be any faster if stored as a hash of qrs for the head and one line body
stuff ? Maybe you have already tried that though.
Something like this is already done with the _eval tests
sub _eval_tests_type11_pri0_set1 {
my ($self, @extraevalargs) = @_;
my $scoresptr = $self->{conf}->{scores};
my $prepend2desc = q#BODY: #;
my $rulename;
my $result;
f($scoresptr->{q#__HTML_LENGTH_1024_1536#}){$rulename=q#__HTML_LENGTH_1024_1536#;$self->{test_log_msgs}=();$self->{current_rule_name}=$rulename;$self->register_plugin_eval_glue(q#html_range#);eval{$result=$self->html_range
(@extraevalargs ,q#length#, q#1024#, q#1536#
);};if($@){$self->handle_eval_rule_errors($rulename);}if($result){$self->got_hit($rulename,$prepend2desc,ruletype=>"eval",value=>$result);
}}
...
--
Configure bugmail:
https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.