Reranko05 commented on PR #50568:
URL: https://github.com/apache/arrow/pull/50568#issuecomment-5040925006

   @kou It was just a temporary benchmark. I used the following to measure 
`IntegrationJsonWriter::WriteRecordBatch() + Finish()` on a 1M-row 
`RecordBatch`:
   
   ```
   auto schema = ::arrow::schema({
       field("f1", boolean()),
       field("f2", int8()),
       field("f3", int32()),
       field("f4", uint64()),
       field("f5", utf8())
   });
   
   std::vector<std::shared_ptr<Array>> arrays;
   const int num_rows = 1000000;
   MakeBatchArrays(schema, num_rows, &arrays);
   
   auto batch = RecordBatch::Make(schema, num_rows, arrays);
   
   ASSERT_OK_AND_ASSIGN(auto writer, IntegrationJsonWriter::Open(schema));
   
   auto start = std::chrono::steady_clock::now();
   
   ASSERT_OK(writer->WriteRecordBatch(*batch));
   ASSERT_OK_AND_ASSIGN(auto json_data, writer->Finish());
   
   auto end = std::chrono::steady_clock::now();
   
   std::cout << "Serialization time: "
             << std::chrono::duration_cast<std::chrono::milliseconds>(
                    end - start)
                    .count()
             << " ms\n";
   ```
   I ran it 10 times on both `main` and this branch, discarded one obvious 
outlier from each set, and compared the average serialization time.


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