| 802 | BENCHMARK(BM_ReadIndividualRowGroups); |
| 803 | |
| 804 | static 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 | |
| 827 | BENCHMARK(BM_ReadMultipleRowGroups); |
| 828 |
nothing calls this directly
no test coverage detected