Commits


mwish authored and GitHub committed 84583d65306
GH-37434: [C++] IO: Refactor BufferedInputStream::Read for small input (#37460) ### Rationale for this change If we Set BufferSize == 100k, and read 3k bytes per IO. When we read the 34 times, the IO would be (99k, 102k] In Read, it will read buffered (99k, 100k], issue IO for (100k, 102k]. Rather than (100k, 200k]. ### What changes are included in this PR? Refactor `BufferedInputStream::Read` to optimize small IO. ### Are these changes tested? Already has tests? ### Are there any user-facing changes? User might get io-pattern changed. It can be optimization or downgrade. * Closes: #37434 Lead-authored-by: mwish <maplewish117@gmail.com> Co-authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Antoine Pitrou <antoine@python.org>