fn benchmark_read_group_vary_rows(
    c: &mut Criterion,
    benchmark_group_name: &str,
    row_sizes: &[usize],
    predicate: &Predicate,
    group_columns: (Vec<&str>, usize),
    rng: &mut ThreadRng,
) {
    let mut group = c.benchmark_group(benchmark_group_name);

    for num_rows in row_sizes {
        let row_group = generate_row_group(*num_rows, rng);

        // benchmark measures the throughput of group creation.
        group.throughput(Throughput::Elements(group_columns.1 as u64));

        group.bench_function(
            BenchmarkId::from_parameter(format!(
                "cardinality_{:?}_columns_{:?}_rows_{:?}",
                group_columns.1,
                group_columns.0.len(),
                num_rows
            )),
            |b| {
                b.iter(|| {
                    let result = row_group.read_aggregate(
                        predicate,
                        group_columns.0.as_slice(),
                        &[("duration", AggregateType::Count)],
                    );

                    // data_centre cardinality is split across env
                    assert_eq!(result.cardinality(), group_columns.1, "{}", &result);
                });
            },
        );
    }
    group.finish();
}
// This benchmarks the impact that the number of rows in a `RowGroup` has on the
// performance of read_group.
This benchmarks the impact that the number of rows in a `RowGroup` has on the
performance of read_group.
This benchmarks the impact that the number of rows in a ` RowGroup ` has on the performance of read_group .
fn benchmark_read_group_vary_rows(
    c: &mut Criterion,
    benchmark_group_name: &str,
    row_sizes: &[usize],
    predicate: &Predicate,
    group_columns: (Vec<&str>, usize),
    rng: &mut ThreadRng,
) {
    let mut group = c.benchmark_group(benchmark_group_name);
    for num_rows in row_sizes {
        let row_group = generate_row_group(*num_rows, rng);
        // benchmark measures the throughput of group creation.
        group.throughput(Throughput::Elements(group_columns.1 as u64));
        group.bench_function(
            BenchmarkId::from_parameter(format!(
                "cardinality_{:?}_columns_{:?}_rows_{:?}",
                group_columns.1,
                group_columns.0.len(),
                num_rows
            )),
            |b| {
                b.iter(|| {
                    let result = row_group.read_aggregate(
                        predicate,
                        group_columns.0.as_slice(),
                        &[("duration", AggregateType::Count)],
                    );
                    // data_centre cardinality is split across env
                    assert_eq!(result.cardinality(), group_columns.1, "{}", &result);
                });
            },
        );
    }
    group.finish();
}
fn benchmark_read_group_vary_rows ( c : & mut Criterion , benchmark_group_name : & str , row_sizes : & [ usize ] , predicate : & Predicate , group_columns : ( Vec < & str > , usize ) , rng : & mut ThreadRng , ) { let mut group = c . benchmark_group ( benchmark_group_name ) ; for num_rows in row_sizes { let row_group = generate_row_group ( * num_rows , rng ) ; // benchmark measures the throughput of group creation. group . throughput ( Throughput :: Elements ( group_columns . 1 as u64 ) ) ; group . bench_function ( BenchmarkId :: from_parameter ( format ! ( " " group_columns 1 group_columns 0 len ( ) num_rows ) ) , | b | { b . iter ( | | { let result = row_group . read_aggregate ( predicate , group_columns . 0 . as_slice ( ) , & [ ( " " , AggregateType :: Count ) ] , ) ; // data_centre cardinality is split across env assert_eq ! ( result cardinality ( ) group_columns 1 " " result ) ; } ) ; } , ) ; } group . finish ( ) ; }
This benchmarks the impact that the number of rows in a `RowGroup` has on the
performance of read_group.
This benchmarks the impact that the number of rows in a ` RowGroup ` has on the performance of read_group .
c
&mut Criterion
benchmark_group_name
&str
row_sizes
&[usize]
predicate
&Predicate
group_columns
(Vec<&str>, usize)
rng
&mut ThreadRng
c
&mut Criterion
benchmark_group_name
&str
row_sizes
&[usize]
predicate
&Predicate
group_columns
(Vec<&str>, usize)
rng
&mut ThreadRng