summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-02-11 09:40:34 +0100
committerJürg Billeter <j@bitron.ch>2019-02-11 15:31:39 +0100
commitaabdf1b92bec1eb6c3b53c046e7be218443ac795 (patch)
tree10eeb6e53184e3256aadcd2a3a28b0cd471eefae
parenta66f83799730a84be9319f80344458cca45dd094 (diff)
downloadbuildstream-aabdf1b92bec1eb6c3b53c046e7be218443ac795.tar.gz
utils.py: Increase buffer size in sha256sum()
Increasing buffer size from 4 kB to 64 kB speeds up read() bandwidth by factor 4, according to a very simple benchmark.
-rw-r--r--buildstream/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/buildstream/utils.py b/buildstream/utils.py
index 76f95637e..b739ca658 100644
--- a/buildstream/utils.py
+++ b/buildstream/utils.py
@@ -235,7 +235,7 @@ def sha256sum(filename):
try:
h = hashlib.sha256()
with open(filename, "rb") as f:
- for chunk in iter(lambda: f.read(4096), b""):
+ for chunk in iter(lambda: f.read(65536), b""):
h.update(chunk)
except OSError as e: