Skip to content

Commit

Permalink
Fix benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
sunchao committed Nov 28, 2018
1 parent 04beb3c commit f6be10f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rust/benches/array_from_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn array_from_vec(n: usize) {
let arr_data = ArrayDataBuilder::new(DataType::Int32)
.add_buffer(Buffer::from(v))
.build();
criterion::black_box(PrimitiveArray::<i32>::from(arr_data));
criterion::black_box(Int32Array::from(arr_data));
}

fn criterion_benchmark(c: &mut Criterion) {
Expand Down
8 changes: 4 additions & 4 deletions rust/benches/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ fn bench_primitive(c: &mut Criterion) {
"bench_primitive",
Benchmark::new("bench_primitive", move |b| {
b.iter(|| {
let mut builder = PrimitiveArrayBuilder::<i64>::new(64);
let mut builder = Int64Builder::new(64);
for _ in 0..NUM_BATCHES {
black_box(builder.push_slice(&data[..]));
let _ = black_box(builder.push_slice(&data[..]));
}
black_box(builder.finish());
})
Expand All @@ -58,9 +58,9 @@ fn bench_bool(c: &mut Criterion) {
"bench_bool",
Benchmark::new("bench_bool", move |b| {
b.iter(|| {
let mut builder = PrimitiveArrayBuilder::<bool>::new(64);
let mut builder = BooleanBuilder::new(64);
for _ in 0..NUM_BATCHES {
black_box(builder.push_slice(&data[..]));
let _ = black_box(builder.push_slice(&data[..]));
}
black_box(builder.finish());
})
Expand Down

0 comments on commit f6be10f

Please sign in to comment.