@@ -417,22 +417,34 @@ BENCHMARK_TEMPLATE2(BM_ReadColumn, true, BooleanType)
417417 ->Args({5 , 10 });
418418
419419//
420- // Benchmark reading a PLAIN -encoded primitive column
420+ // Benchmark reading a non-dict -encoded primitive column
421421//
422422
423- template <bool nullable, typename ParquetType>
424- static void BM_ReadColumnPlain (::benchmark::State& state) {
423+ template <typename ParquetType>
424+ static void BenchmarkReadNonDictColumn (::benchmark::State& state, bool nullable,
425+ Encoding::type encoding) {
425426 using c_type = typename ArrowType<ParquetType>::c_type;
426427
427428 const std::vector<c_type> values (BENCHMARK_SIZE , static_cast <c_type>(42 ));
428429 std::shared_ptr<Table> table =
429430 TableFromVector<ParquetType>(values, /* nullable=*/ nullable, state.range (0 ));
430431
431- auto properties = WriterProperties::Builder ().disable_dictionary ()->build ();
432+ auto properties =
433+ WriterProperties::Builder ().disable_dictionary ()->encoding (encoding)->build ();
432434 BenchmarkReadTable (state, *table, properties, table->num_rows (),
433435 BytesForItems<ParquetType>(table->num_rows ()));
434436}
435437
438+ template <bool nullable, typename ParquetType>
439+ static void BM_ReadColumnPlain (::benchmark::State& state) {
440+ BenchmarkReadNonDictColumn<ParquetType>(state, nullable, Encoding::PLAIN );
441+ }
442+
443+ template <bool nullable, typename ParquetType>
444+ static void BM_ReadColumnByteStreamSplit (::benchmark::State& state) {
445+ BenchmarkReadNonDictColumn<ParquetType>(state, nullable, Encoding::BYTE_STREAM_SPLIT );
446+ }
447+
436448BENCHMARK_TEMPLATE2 (BM_ReadColumnPlain, false , Int32Type)
437449 ->ArgNames ({" null_probability" })
438450 ->Args({kAlternatingOrNa });
@@ -455,12 +467,24 @@ BENCHMARK_TEMPLATE2(BM_ReadColumnPlain, true, Float16LogicalType)
455467 ->Args({99 })
456468 ->Args({100 });
457469
470+ BENCHMARK_TEMPLATE2 (BM_ReadColumnByteStreamSplit, false , Float16LogicalType)
471+ ->ArgNames ({" null_probability" })
472+ ->Args({kAlternatingOrNa });
473+ BENCHMARK_TEMPLATE2 (BM_ReadColumnByteStreamSplit, true , Float16LogicalType)
474+ ->ArgNames ({" null_probability" })
475+ ->Args({0 })
476+ ->Args({1 })
477+ ->Args({50 })
478+ ->Args({99 })
479+ ->Args({100 });
480+
458481//
459482// Benchmark reading binary column
460483//
461484
462485static void BenchmarkReadBinaryColumn (::benchmark::State& state,
463- const std::shared_ptr<::arrow::DataType>& type) {
486+ const std::shared_ptr<::arrow::DataType>& type,
487+ Encoding::type encoding) {
464488 std::shared_ptr<Table> table =
465489 RandomStringTable (type, BENCHMARK_SIZE , state.range (1 ), state.range (0 ));
466490
@@ -470,7 +494,9 @@ static void BenchmarkReadBinaryColumn(::benchmark::State& state,
470494 for (size_t i = 1 ; i < column.buffers .size (); ++i) {
471495 total_bytes += column.buffers [i]->size ();
472496 }
473- BenchmarkReadTable (state, *table, table->num_rows (), total_bytes);
497+
498+ auto properties = WriterProperties::Builder ().encoding (encoding)->build ();
499+ BenchmarkReadTable (state, *table, properties, table->num_rows (), total_bytes);
474500}
475501
476502static void SetReadBinaryColumnArgs (benchmark::internal::Benchmark* b) {
@@ -487,17 +513,41 @@ static void SetReadBinaryColumnArgs(benchmark::internal::Benchmark* b) {
487513 ->Args ({99 , kInfiniteUniqueValues });
488514}
489515
516+ static void SetReadBinaryColumnArgsWithoutDictEncoding (
517+ benchmark::internal::Benchmark* b) {
518+ b->ArgNames ({" null_probability" , " unique_values" })
519+ // Dict-encoding is already tested in the PLAIN benchmarks, so only exercise
520+ // non-dict-encoding using high cardinality.
521+ ->Args ({0 , kInfiniteUniqueValues })
522+ ->Args ({1 , kInfiniteUniqueValues })
523+ ->Args ({50 , kInfiniteUniqueValues })
524+ ->Args ({99 , kInfiniteUniqueValues });
525+ }
526+
490527static void BM_ReadBinaryColumn (::benchmark::State& state) {
491- BenchmarkReadBinaryColumn (state, ::arrow::utf8 ());
528+ BenchmarkReadBinaryColumn (state, ::arrow::utf8 (), Encoding:: PLAIN );
492529}
493530
494531static void BM_ReadBinaryViewColumn (::benchmark::State& state) {
495- BenchmarkReadBinaryColumn (state, ::arrow::large_utf8 ());
532+ BenchmarkReadBinaryColumn (state, ::arrow::large_utf8 (), Encoding::PLAIN );
533+ }
534+
535+ static void BM_ReadBinaryColumnDeltaByteArray (::benchmark::State& state) {
536+ BenchmarkReadBinaryColumn (state, ::arrow::utf8 (), Encoding::DELTA_BYTE_ARRAY );
537+ }
538+
539+ static void BM_ReadBinaryViewColumnDeltaByteArray (::benchmark::State& state) {
540+ BenchmarkReadBinaryColumn (state, ::arrow::large_utf8 (), Encoding::DELTA_BYTE_ARRAY );
496541}
497542
498543BENCHMARK (BM_ReadBinaryColumn)->Apply (SetReadBinaryColumnArgs);
499544BENCHMARK (BM_ReadBinaryViewColumn)->Apply (SetReadBinaryColumnArgs);
500545
546+ BENCHMARK (BM_ReadBinaryColumnDeltaByteArray)
547+ ->Apply (SetReadBinaryColumnArgsWithoutDictEncoding);
548+ BENCHMARK (BM_ReadBinaryViewColumnDeltaByteArray)
549+ ->Apply (SetReadBinaryColumnArgsWithoutDictEncoding);
550+
501551//
502552// Benchmark reading a nested column
503553//
0 commit comments