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-12 06:52:07 +0100
commita7aed65a09a96ee242a0a0cc60d8dadd2dfc8664 (patch)
treec79273a84656119ff5bc69d79873a3fb487e5dc3
parent0816b8b19297cbefd4273d9694d0463fcad0a848 (diff)
downloadbuildstream-a7aed65a09a96ee242a0a0cc60d8dadd2dfc8664.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: