Alon Bar-Lev has posted comments on this change.

Change subject: packagine: setup: Keep md5 sums of entire conf files
......................................................................


Patch Set 2: (1 inline comment)

....................................................
File packaging/setup/plugins/ovirt-engine-remove/files/simple.py
Line 45:         md5 = hashlib.new('md5')
Line 46:         # Read file in chunks of 1MiB
Line 47:         with open(filename, 'rb') as f:
Line 48:             while True:
Line 49:                 data = f.read(2**20)
I think that reading 1M into memory is way too much, a decent buffer is 10K, 
50K max.

The problem with large buffers is that until you end reading these, they are 
paged out so when you come and calculate digest you page in, so you create more 
IO and lower performance then reading small buffers.
Line 50:                 if not data:
Line 51:                     break
Line 52:                 md5.update(data)
Line 53:         return md5.hexdigest()


-- 
To view, visit http://gerrit.ovirt.org/16681
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie8dfc2f23d1a395dfb35d12fce97896df057816f
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yedidyah Bar David <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Ofer Schreiber <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Yedidyah Bar David <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to