From 2708fda1e58c14bd2765507f56a9f4f8b33b921a Mon Sep 17 00:00:00 2001 From: Mahesh Madhav Date: Mon, 14 Oct 2024 20:54:13 +0000 Subject: [PATCH] Increase read buffer to reduce total syscalls --- libs/libpugiutil/src/pugixml_loc.cpp | 2 +- libs/libvtrutil/src/vtr_digest.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/libpugiutil/src/pugixml_loc.cpp b/libs/libpugiutil/src/pugixml_loc.cpp index b773b410b53..88041135b84 100644 --- a/libs/libpugiutil/src/pugixml_loc.cpp +++ b/libs/libpugiutil/src/pugixml_loc.cpp @@ -30,7 +30,7 @@ void loc_data::build_loc_data() { std::ptrdiff_t offset = 0; - char buffer[1024]; + char buffer[1048576]; std::size_t size; while ((size = fread(buffer, 1, sizeof(buffer), f)) > 0) { diff --git a/libs/libvtrutil/src/vtr_digest.cpp b/libs/libvtrutil/src/vtr_digest.cpp index aedcd613ecb..6f2b16a8f6d 100644 --- a/libs/libvtrutil/src/vtr_digest.cpp +++ b/libs/libvtrutil/src/vtr_digest.cpp @@ -21,7 +21,7 @@ std::string secure_digest_stream(std::istream& is) { //Read the stream in chunks and calculate the SHA256 digest picosha2::hash256_one_by_one hasher; - std::array buf; + std::array buf; while (!is.eof()) { //Process a chunk is.read(buf.data(), buf.size());