diff options
author | Jürg Billeter <j@bitron.ch> | 2019-02-11 09:40:34 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-02-12 06:52:07 +0100 |
commit | a7aed65a09a96ee242a0a0cc60d8dadd2dfc8664 (patch) | |
tree | c79273a84656119ff5bc69d79873a3fb487e5dc3 | |
parent | 0816b8b19297cbefd4273d9694d0463fcad0a848 (diff) | |
download | buildstream-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.py | 2 |
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: |