emkornfield commented on code in PR #39705:
URL: https://github.com/apache/arrow/pull/39705#discussion_r1462340215


##########
cpp/src/parquet/column_reader_benchmark.cc:
##########
@@ -219,5 +219,87 @@ BENCHMARK(RecordReaderReadRecords)
     ->Args({2, 1000, true})
     ->Args({2, 1000, false});
 
+void GenerateLevels(int level_repeats, int max_level, int num_levels,
+                    std::vector<int16_t>& input_levels) {
+  // Generate random levels
+  std::default_random_engine gen(/*seed=*/1943);
+  std::uniform_int_distribution<int16_t> d(0, max_level);
+  for (int i = 0; i < num_levels;) {
+    int16_t current_level = d(gen);  // level repeat `level_repeats` times
+    for (int j = 0; j < level_repeats; ++j) {
+      input_levels.push_back(current_level);

Review Comment:
   nit: you could use vector::insert to repeat the value for you.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to