mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-18 20:14:49 -04:00
Fix running cargo bench & test in CI. (#14943)
This commit is contained in:
parent
3b8574b4f2
commit
585180594b
3 changed files with 36 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
|||
// limitations under the License.
|
||||
|
||||
#![feature(test)]
|
||||
use std::collections::BTreeSet;
|
||||
use synapse::push::{
|
||||
evaluator::PushRuleEvaluator, Condition, EventMatchCondition, FilteredPushRules, PushRules,
|
||||
};
|
||||
|
@ -32,6 +33,8 @@ fn bench_match_exact(b: &mut Bencher) {
|
|||
|
||||
let eval = PushRuleEvaluator::py_new(
|
||||
flattened_keys,
|
||||
BTreeSet::new(),
|
||||
false,
|
||||
10,
|
||||
Some(0),
|
||||
Default::default(),
|
||||
|
@ -68,6 +71,8 @@ fn bench_match_word(b: &mut Bencher) {
|
|||
|
||||
let eval = PushRuleEvaluator::py_new(
|
||||
flattened_keys,
|
||||
BTreeSet::new(),
|
||||
false,
|
||||
10,
|
||||
Some(0),
|
||||
Default::default(),
|
||||
|
@ -104,6 +109,8 @@ fn bench_match_word_miss(b: &mut Bencher) {
|
|||
|
||||
let eval = PushRuleEvaluator::py_new(
|
||||
flattened_keys,
|
||||
BTreeSet::new(),
|
||||
false,
|
||||
10,
|
||||
Some(0),
|
||||
Default::default(),
|
||||
|
@ -140,6 +147,8 @@ fn bench_eval_message(b: &mut Bencher) {
|
|||
|
||||
let eval = PushRuleEvaluator::py_new(
|
||||
flattened_keys,
|
||||
BTreeSet::new(),
|
||||
false,
|
||||
10,
|
||||
Some(0),
|
||||
Default::default(),
|
||||
|
@ -156,6 +165,7 @@ fn bench_eval_message(b: &mut Bencher) {
|
|||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
);
|
||||
|
||||
b.iter(|| eval.run(&rules, Some("bob"), Some("person")));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue