lidavidm commented on a change in pull request #6744:
URL: https://github.com/apache/arrow/pull/6744#discussion_r413798078



##########
File path: cpp/src/arrow/filesystem/s3fs_benchmark.cc
##########
@@ -331,10 +358,64 @@ BENCHMARK_DEFINE_F(MinioFixture, 
ReadCoalesced500Mib)(benchmark::State& st) {
 }
 BENCHMARK_REGISTER_F(MinioFixture, ReadCoalesced500Mib)->UseRealTime();
 
-BENCHMARK_DEFINE_F(MinioFixture, ReadParquet250K)(benchmark::State& st) {
-  ParquetRead(st, fs_.get(), bucket_ + "/pq_c100_r250k");
-}
-BENCHMARK_REGISTER_F(MinioFixture, ReadParquet250K)->UseRealTime();
+// Helpers to generate various multiple benchmarks for a given Parquet file.
+
+// NAME: the base name of the benchmark.
+// ROWS: the number of rows in the Parquet file.
+// COLS: the number of columns in the Parquet file.
+// STRATEGY: how to read the file (ReadTable or GetRecordBatchReader)
+#define PQ_BENCHMARK_IMPL(NAME, ROWS, COLS, STRATEGY)                          
       \
+  BENCHMARK_DEFINE_F(MinioFixture, NAME##STRATEGY##AllNaive)(benchmark::State 
& st) { \
+    std::vector<int> column_indices(COLS);                                     
       \
+    std::iota(column_indices.begin(), column_indices.end(), 0);                
       \
+    std::stringstream ss;                                                      
       \
+    ss << bucket_ << "/pq_c" << COLS << "_r" << ROWS << "k";                   
       \
+    ParquetRead(st, fs_.get(), ss.str(), column_indices, false, #STRATEGY);    
       \

Review comment:
       Good idea, I've created a set of helper functions that set up things and 
then call the benchmark.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to