Fix the evaluator benchmarks for the knock push rule signatures

PushRuleEvaluator::py_new gained action_power_levels, and
match_condition/run gained recipient_power_level, for the MSC4506
recipient_permission condition — update the benchmark call sites.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uk8aPxHn3BHCe52L226jdG
This commit is contained in:
Matthew Hodgson
2026-07-14 14:07:25 +01:00
co-authored by Claude Fable 5
parent ed18dbeca0
commit cf2863ae15
+12 -7
View File
@@ -57,6 +57,7 @@ fn bench_match_exact(b: &mut Bencher) {
Some(0),
Default::default(),
Default::default(),
Default::default(),
true,
vec![],
false,
@@ -72,10 +73,10 @@ fn bench_match_exact(b: &mut Bencher) {
},
));
let matched = eval.match_condition(&condition, None, None, None).unwrap();
let matched = eval.match_condition(&condition, None, None, None, None).unwrap();
assert!(matched, "Didn't match");
b.iter(|| eval.match_condition(&condition, None, None, None).unwrap());
b.iter(|| eval.match_condition(&condition, None, None, None, None).unwrap());
}
#[bench]
@@ -104,6 +105,7 @@ fn bench_match_word(b: &mut Bencher) {
Some(0),
Default::default(),
Default::default(),
Default::default(),
true,
vec![],
false,
@@ -119,10 +121,10 @@ fn bench_match_word(b: &mut Bencher) {
},
));
let matched = eval.match_condition(&condition, None, None, None).unwrap();
let matched = eval.match_condition(&condition, None, None, None, None).unwrap();
assert!(matched, "Didn't match");
b.iter(|| eval.match_condition(&condition, None, None, None).unwrap());
b.iter(|| eval.match_condition(&condition, None, None, None, None).unwrap());
}
#[bench]
@@ -151,6 +153,7 @@ fn bench_match_word_miss(b: &mut Bencher) {
Some(0),
Default::default(),
Default::default(),
Default::default(),
true,
vec![],
false,
@@ -166,10 +169,10 @@ fn bench_match_word_miss(b: &mut Bencher) {
},
));
let matched = eval.match_condition(&condition, None, None, None).unwrap();
let matched = eval.match_condition(&condition, None, None, None, None).unwrap();
assert!(!matched, "Didn't match");
b.iter(|| eval.match_condition(&condition, None, None, None).unwrap());
b.iter(|| eval.match_condition(&condition, None, None, None, None).unwrap());
}
#[bench]
@@ -198,6 +201,7 @@ fn bench_eval_message(b: &mut Bencher) {
Some(0),
Default::default(),
Default::default(),
Default::default(),
true,
vec![],
false,
@@ -216,7 +220,8 @@ fn bench_eval_message(b: &mut Bencher) {
false,
false,
false,
false,
);
b.iter(|| eval.run(&rules, Some("bob"), Some("person"), None));
b.iter(|| eval.run(&rules, Some("bob"), Some("person"), None, None));
}