Skip to content

Commit

Permalink
fix / add benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangb committed Feb 6, 2023
1 parent eb7009c commit 3bc6516
Show file tree
Hide file tree
Showing 4 changed files with 294 additions and 12 deletions.
179 changes: 178 additions & 1 deletion pgpq/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pgpq/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ features = ["chrono-tz"]
rstest = ">=0.16.0"
parquet = ">=32.0.0"
criterion = ">=0.4.0"
arrow = ">=32.0.0"

[[bench]]
name = "benchmarks"
harness = false

[[bench]]
name = "columnar_vs_rows"
harness = false
13 changes: 2 additions & 11 deletions pgpq/benches/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use arrow::datatypes::{DataType, Schema, TimeUnit};
use arrow::record_batch::RecordBatchReader;
use arrow_array::RecordBatch;
use bytes::BytesMut;
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use criterion::{criterion_group, criterion_main, Criterion};
use parquet::arrow::arrow_reader::{ParquetRecordBatchReader, ParquetRecordBatchReaderBuilder};
use pgpq::ArrowToPostgresBinaryEncoder;
use std::fs;
Expand Down Expand Up @@ -53,14 +53,5 @@ pub fn benchmark_nyc_taxi_full(c: &mut Criterion) {
});
}

pub fn benchmark_approaches(c: &mut Criterion) {
let mut group = c.benchmark_group("benchmark_approaches");
group.bench_function("dyn_to_buffer", |b| {
b.iter_with_setup(|| setup(None), |(records, schema) {
let out =
})
});
}

criterion_group!(benches, benchmark_nyc_taxi_small, benchmark_nyc_taxi_full, benchmark_dyn_to_buffer);
criterion_group!(benches, benchmark_nyc_taxi_small, benchmark_nyc_taxi_full);
criterion_main!(benches);
Loading

0 comments on commit 3bc6516

Please sign in to comment.