]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
mkosi: increase buffer size when hashing files 45/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 8 Dec 2016 15:16:21 +0000 (10:16 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 8 Dec 2016 15:16:21 +0000 (10:16 -0500)
We need to do some buffering here, because the files we are hashing can be gigabytes
in size, but Python loops are slow, so it's better to use a larger buffer.

mkosi

diff --git a/mkosi b/mkosi
index 35db5bc602ed8a8c9b9ff9ef0d82ec6659561ce3..e3f325655ebb5ffdc1b0a8758bc8f9713339689a 100755 (executable)
--- a/mkosi
+++ b/mkosi
@@ -1074,7 +1074,7 @@ def copy_nspawn_settings(args):
     return f
 
 def hash_file(of, sf, fname):
-    bs = 65536
+    bs = 16*1024**2
     h = hashlib.sha256()
 
     sf.seek(0)