You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/14 02:16:26 UTC
[GitHub] [arrow] westonpace commented on a change in pull request #11616: ARROW-14577: [C++] Enable fine grained IO for async IPC reader
westonpace commented on a change in pull request #11616:
URL: https://github.com/apache/arrow/pull/11616#discussion_r784462234
##########
File path: cpp/src/arrow/ipc/read_write_benchmark.cc
##########
@@ -49,9 +51,29 @@ std::shared_ptr<RecordBatch> MakeRecordBatch(int64_t total_size, int64_t num_fie
return RecordBatch::Make(schema, length, arrays);
}
+std::vector<int> GetIncludedFields(int64_t num_fields, int64_t is_partial_read) {
+ if (is_partial_read) {
+ std::vector<int> field_indices;
+ for (int i = 0; i < num_fields; i += 8) {
+ field_indices.push_back(i);
+ }
+ return field_indices;
+ } else {
+ return std::vector<int>();
+ }
+}
+
+int64_t BytesPerIteration(int64_t num_fields, int64_t is_partial_read, int64_t batch_size, int64_t num_batches) {
+ std::size_t num_actual_fields = GetIncludedFields(num_fields, is_partial_read).size();
+ double selectivity = num_actual_fields / static_cast<double>(num_fields);
+ if (num_actual_fields == 0) selectivity = 1;
+ auto bytes = batch_size * num_batches * selectivity;
+ return static_cast<int64_t>(bytes);
+}
+
static void WriteRecordBatch(benchmark::State& state) { // NOLINT non-const reference
// 1MB
- constexpr int64_t kTotalSize = 1 << 20;
+ constexpr int64_t kTotalSize = 1 << 23;
Review comment:
I've put the benchmarks changes in their own PR.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org