fn benchmark_read_group_vary_group_cols(
    c: &mut Criterion,
    benchmark_group_name: &str,
    row_group: &RowGroup,
    predicates: &Predicate,
    group_columns: &[(Vec<&str>, usize)],
) {
    let mut group = c.benchmark_group(benchmark_group_name);

    for (group_cols, expected_cardinality) in group_columns {
        let num_cols = group_cols.len();
        // benchmark measures the throughput of group creation.
        group.throughput(Throughput::Elements(*expected_cardinality as u64));

        group.bench_with_input(
            BenchmarkId::from_parameter(format!(
                "cardinality_{:?}_columns_{:?}_rows_{:?}",
                *expected_cardinality, num_cols, 500_000
            )),
            &group_cols,
            |b, group_cols| {
                b.iter(|| {
                    let result = row_group.read_aggregate(
                        predicates,
                        group_cols.as_slice(),
                        &[("duration", AggregateType::Count)],
                    );

                    assert_eq!(result.cardinality(), *expected_cardinality, "{}", &result);
                });
            },
        );
    }
    group.finish();
}
// This benchmarks the impact that the number of group columns has on the
// performance of read_group.
This benchmarks the impact that the number of group columns has on the
performance of read_group.
This benchmarks the impact that the number of group columns has on the performance of read_group .
fn benchmark_read_group_vary_group_cols(
    c: &mut Criterion,
    benchmark_group_name: &str,
    row_group: &RowGroup,
    predicates: &Predicate,
    group_columns: &[(Vec<&str>, usize)],
) {
    let mut group = c.benchmark_group(benchmark_group_name);
    for (group_cols, expected_cardinality) in group_columns {
        let num_cols = group_cols.len();
        // benchmark measures the throughput of group creation.
        group.throughput(Throughput::Elements(*expected_cardinality as u64));
        group.bench_with_input(
            BenchmarkId::from_parameter(format!(
                "cardinality_{:?}_columns_{:?}_rows_{:?}",
                *expected_cardinality, num_cols, 500_000
            )),
            &group_cols,
            |b, group_cols| {
                b.iter(|| {
                    let result = row_group.read_aggregate(
                        predicates,
                        group_cols.as_slice(),
                        &[("duration", AggregateType::Count)],
                    );
                    assert_eq!(result.cardinality(), *expected_cardinality, "{}", &result);
                });
            },
        );
    }
    group.finish();
}
fn benchmark_read_group_vary_group_cols ( c : & mut Criterion , benchmark_group_name : & str , row_group : & RowGroup , predicates : & Predicate , group_columns : & [ ( Vec < & str > , usize ) ] , ) { let mut group = c . benchmark_group ( benchmark_group_name ) ; for ( group_cols , expected_cardinality ) in group_columns { let num_cols = group_cols . len ( ) ; // benchmark measures the throughput of group creation. group . throughput ( Throughput :: Elements ( * expected_cardinality as u64 ) ) ; group . bench_with_input ( BenchmarkId :: from_parameter ( format ! ( " " expected_cardinality num_cols 500_000 ) ) , & group_cols , | b , group_cols | { b . iter ( | | { let result = row_group . read_aggregate ( predicates , group_cols . as_slice ( ) , & [ ( " " , AggregateType :: Count ) ] , ) ; assert_eq ! ( result cardinality ( ) expected_cardinality " " result ) ; } ) ; } , ) ; } group . finish ( ) ; }
This benchmarks the impact that the number of group columns has on the
performance of read_group.
This benchmarks the impact that the number of group columns has on the performance of read_group .
c
&mut Criterion
benchmark_group_name
&str
row_group
&RowGroup
predicates
&Predicate
group_columns
&[(Vec<&str>, usize)]
c
&mut Criterion
benchmark_group_name
&str
row_group
&RowGroup
predicates
&Predicate
group_columns
&[(Vec<&str>, usize)]