MCPcopy Create free account
hub / github.com/apache/arrow / BM_ReadMultipleRowGroups

Function BM_ReadMultipleRowGroups

cpp/src/parquet/arrow/reader_writer_benchmark.cc:804–825  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802BENCHMARK(BM_ReadIndividualRowGroups);
803
804static void BM_ReadMultipleRowGroups(::benchmark::State& state) {
805 std::vector<int64_t> values(BENCHMARK_SIZE, 128);
806 std::shared_ptr<Table> table = TableFromVector<Int64Type>(values, true);
807 auto output = CreateOutputStream();
808 // This writes 10 RowGroups
809 EXIT_NOT_OK(
810 WriteTable(*table, ::arrow::default_memory_pool(), output, BENCHMARK_SIZE / 10));
811 PARQUET_ASSIGN_OR_THROW(auto buffer, output->Finish());
812 std::vector<int> rgs{0, 2, 4, 6, 8};
813
814 while (state.KeepRunning()) {
815 auto reader =
816 ParquetFileReader::Open(std::make_shared<::arrow::io::BufferReader>(buffer));
817 auto arrow_reader_result =
818 FileReader::Make(::arrow::default_memory_pool(), std::move(reader));
819 EXIT_NOT_OK(arrow_reader_result.status());
820 auto arrow_reader = std::move(*arrow_reader_result);
821
822 PARQUET_ASSIGN_OR_THROW(auto table, arrow_reader->ReadRowGroups(rgs));
823 }
824 SetBytesProcessed<Int64Type>(state);
825}
826
827BENCHMARK(BM_ReadMultipleRowGroups);
828

Callers

nothing calls this directly

Calls 5

CreateOutputStreamFunction · 0.85
default_memory_poolFunction · 0.85
WriteTableFunction · 0.70
MakeFunction · 0.50
statusMethod · 0.45

Tested by

no test coverage detected