lidavidm commented on a change in pull request #9656: URL: https://github.com/apache/arrow/pull/9656#discussion_r606286443
########## File path: cpp/src/arrow/ipc/reader.cc ########## @@ -1022,7 +1111,24 @@ class RecordBatchFileReaderImpl : public RecordBatchFileReader { ReadStats stats() const override { return stats_; } + Result<AsyncGenerator<std::shared_ptr<RecordBatch>>> GetRecordBatchGenerator( + int readahead_messages, const io::IOContext& io_context, + arrow::internal::Executor* executor) override { + auto state = std::dynamic_pointer_cast<RecordBatchFileReaderImpl>(shared_from_this()); + auto message_generator = MakeMessageGenerator(state, io_context); + if (readahead_messages > 0) { + message_generator = MakeReadaheadGenerator(message_generator, readahead_messages); + } + return IpcFileRecordBatchGenerator( + std::move(state), std::move(message_generator), + executor ? executor : arrow::internal::GetCpuThreadPool()); Review comment: Reducing the # of I/O calls improves S3 quite a bit. Avoiding the transfer worsens S3 slightly but improves the local file case, to the point where it's on par again with 4.0 master.   -- 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