Skip to content

Commit e3a15bd

Browse files
committed
test(cubesql): Add rules loading benchmark
1 parent 66b9803 commit e3a15bd

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

rust/cubesql/cubesql/benches/benchmarks.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,4 +743,26 @@ criterion_group! {
743743
targets = split_query, split_query_count_distinct, wrapped_query, power_bi_wrap, power_bi_sum_wrap, long_in_expr, long_simple_in_number_expr_1k, long_simple_in_str_expr_50, long_simple_in_str_expr_1k, tableau_logical_17,
744744
tableau_bugs_b8888, ts_last_day_redshift, quicksight_1, quicksight_2
745745
}
746-
criterion_main!(benches);
746+
747+
fn simple_rules_loading(c: &mut Criterion) {
748+
let context = Arc::new(
749+
futures::executor::block_on(create_test_postgresql_cube_context(get_test_tenant_ctx()))
750+
.unwrap(),
751+
);
752+
// preload rules at least once
753+
let _rules = rewrite_rules(context.clone());
754+
755+
c.bench_function("simple_rules_loading", |b| {
756+
b.iter(|| {
757+
rewrite_rules(context.clone());
758+
})
759+
});
760+
}
761+
762+
criterion_group! {
763+
name = rules_loading;
764+
config = Criterion::default();
765+
targets = simple_rules_loading
766+
}
767+
768+
criterion_main!(benches, rules_loading);

0 commit comments

Comments
 (0)