mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-26 06:55:48 +00:00
1bdf4e5351
The current code was more of a subpar, temporary solution. However, we need a stable solution in case more variables will be deprecated in the future (T213006 fixes the problem for the past deprecation round). So, instead of setting a hacky property, directly translate all variables when loading the var dump. This is not only stable, but has a couple micro-performance advantages: - Calling getDeprecatedVariables happens only once when loading the dump, and not every time a variable is accessed - No checks are needed when retrieving a variable, because names can always assumed to be new Some simple benchmarks reveals a runtime reduction of 8-15% compared to the old code (8% when it had varsVersion = 2, 15% for varsVersion = 1), which comes at no cost together with increased readability and stability. It ain't much, but it's honest work. Change-Id: Ib32a92c4ad939790633aa63eb3ef8d4629488bea |
||
---|---|---|
.. | ||
unit | ||
AbuseFilterConsequencesTest.php | ||
AbuseFilterDBTest.php | ||
AbuseFilterParserEquivsetTest.php | ||
AbuseFilterSaveTest.php | ||
AbuseFilterVariableGeneratorDBTest.php | ||
UpdateVarDumpsTest.php |