https://bugzilla.wikimedia.org/show_bug.cgi?id=18165
Summary: Inefficiency of creating multiple parsers for a single
rule set
Product: MediaWiki extensions
Version: any
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: Normal
Component: AbuseFilter
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
The way the code currently works its way through the rule set has an
unnecessary major inefficiency.
For each rule, AbuseFilter::checkAllFilters calls AbuseFilter::checkConditions
with the $conds and $vars.
$vars is of course the spiffy variable class preloaded with a combination of
already fetched and buildable data.
checkConditions then creates a new AbuseFilterParserClass and loads it with
$vars.
The problem here is that a new parser is being created for every rule
evaluation. As currently implemented that means the subsequent rules aren't
getting the benefit of the work done by prior rules. In particular, the
funcCache is being cleared and the variable holder reset to its initial state.
What you want is for a single parser instance to be used for the processing of
the entire rule set, that way the evaluation of functions and loading of
variables is cached the whole way through, and not just within a single rule.
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l