Ido Barkan has posted comments on this change. Change subject: fixing race while sampling interfaces ......................................................................
Patch Set 2: (1 comment) http://gerrit.ovirt.org/#/c/36138/2/vdsm/virt/sampling.py File vdsm/virt/sampling.py: Line 215: raise ValueError('Boot time not present') Line 216: Line 217: Line 218: def _get_interfaces_and_samples(): Line 219: links_and_samples = dict() > {} is (was??) considerably faster than dict(). right. on Python 2.7 dict() is 3 time slower than {}, probably because the locals and global lookup: In [1]: %timeit {} 10000000 loops, best of 3: 27.4 ns per loop In [2]: %timeit dict() 10000000 loops, best of 3: 83.7 ns per loop fixing double indent. Line 220: for link in getLinks(): Line 221: try: Line 222: links_and_samples[link.name] = InterfaceSample(link) Line 223: except IOError as e: -- To view, visit http://gerrit.ovirt.org/36138 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I059a5bfa4c140d88f512dc9a51d18f02956710de Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ido Barkan <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Ido Barkan <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
