Skip to content

Commit

Permalink
Benchmark with prepared row converter (#2930)
Browse files Browse the repository at this point in the history
* Benchmark with prepared row converter

* Update arrow/benches/row_format.rs

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
  • Loading branch information
tustvold and alamb committed Oct 26, 2022
1 parent a9f632c commit 994be05
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arrow/benches/row_format.rs
Expand Up @@ -45,6 +45,10 @@ fn do_bench(c: &mut Criterion, name: &str, cols: Vec<ArrayRef>) {

let mut converter = RowConverter::new(fields);
let rows = converter.convert_columns(&cols).unwrap();
// using a pre-prepared row converter should be faster than the first time
c.bench_function(&format!("convert_columns_prepared {}", name), |b| {
b.iter(|| black_box(converter.convert_columns(&cols).unwrap()));
});

c.bench_function(&format!("convert_rows {}", name), |b| {
b.iter(|| black_box(converter.convert_rows(&rows).unwrap()));
Expand Down

0 comments on commit 994be05

Please sign in to comment.