Martin Sivák has posted comments on this change. Change subject: Cache the result of numaUtils.getVcpuPids ......................................................................
Patch Set 7: (1 comment) No tests except what we already had (and that uses the cache). I would have to mock the filesystem ops to really test everything here. https://gerrit.ovirt.org/#/c/38564/7/vdsm/numaUtils.py File vdsm/numaUtils.py: Line 53: try: Line 54: if path in _libvirt_vcpu_pids_cache: Line 55: lastmtime, value = _libvirt_vcpu_pids_cache[path] Line 56: if lastmtime == mtime: Line 57: return value > quite minor: I did not want to handle the expected case of empty cache using the exception. There is a slight performance penalty in catching an exception. But it is true that the key should be available most of the time.. Line 58: except KeyError: Line 59: # Make sure we do not crash if the cache is suddenly Line 60: # invalidated Line 61: pass -- To view, visit https://gerrit.ovirt.org/38564 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I135143bccdd29697ec673819212193c0fc217e56 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Sivák <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Gilad Chaplik <[email protected]> Gerrit-Reviewer: Martin Sivák <[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
