Yedidyah Bar David 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 1M is very reasonable. We alert the user if there is less than 4GiB and 
recommend 16GiB.

I think reading in chunks of 10K will lower performance considerably, although 
I didn't measure.

Are you sure about paging? As far as I understand, md5 calculates while 
reading, when I call 'update'. If it really needs to read the entire file 
before calculating, there is no point in reading in chunks.
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