Change in vdsm[master]: hostdev: add caching of device tree

2016-12-06 Thread Code Review
From Dan Kenigsberg :

Dan Kenigsberg has submitted this change and it was merged.

Change subject: hostdev: add caching of device tree
..


hostdev: add caching of device tree

Previously, we've kept asking libvirt about devices and parsed them as
we went. This had unfortunate effect of O(n^2) complexity with O(n)
libvirt calls.

Now, we are able to accomplish what we previously did in O(n) time
with a O(1) calls.

Previous run: (interrupted, too boring)

time PYTHONPATH="../" NOSE_SLOW_TESTS=true ./run_tests.sh -s -m
test_3k_storage_devices hostdevTests.py
nose.config: INFO: Ignoring files matching ['^\\.', '^_',
'^setup\\.py$']
hostdevTests.HostdevPerformanceTests
test_3k_storage_devices ^C
--
Ran 1 test in 506.604s

OK

real8m26.956s
user8m26.572s
sys 0m0.385s

Run after caching:

time PYTHONPATH="../" NOSE_SLOW_TESTS=true ./run_tests.sh -s -m
test_3k_storage_devices hostdevTests.py
nose.config: INFO: Ignoring files matching ['^\\.', '^_',
'^setup\\.py$']
hostdevTests.HostdevPerformanceTests
test_3k_storage_devices OK

--
Ran 1 test in 2.656s

OK

real0m3.010s
user0m2.951s
sys 0m0.060s

(approx ~1.9s for the call itself)

Change-Id: I5b901fac8df23aed958fb9509008f9cfaee648c3
Bug-Url: https://bugzilla.redhat.com/1398572
Signed-off-by: Martin Polednik 
---
M lib/vdsm/hostdev.py
1 file changed, 64 insertions(+), 22 deletions(-)

Approvals:
  Jenkins CI: Passed CI tests
  Francesco Romani: Looks good to me, approved
  Martin Polednik: Verified



-- 
To view, visit https://gerrit.ovirt.org/67457
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5b901fac8df23aed958fb9509008f9cfaee648c3
Gerrit-PatchSet: 10
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Yaniv Kaul 
Gerrit-Reviewer: gerrit-hooks 
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org


Change in vdsm[master]: hostdev: add caching of device tree

2016-12-01 Thread Code Review
From Dan Kenigsberg :

Dan Kenigsberg has posted comments on this change.

Change subject: hostdev: add caching of device tree
..


Patch Set 7:

(2 comments)

very partial

https://gerrit.ovirt.org/#/c/67457/7/lib/vdsm/hostdev.py
File lib/vdsm/hostdev.py:

Line 68: class UnsuitableSCSIDevice(Exception):
Line 69: pass
Line 70: 
Line 71: 
Line 72: class DeviceTreeCache(object):
I hope this is not going to be public
Line 73: 
Line 74: def __init__(self, devices):
Line 75: self._parent_to_device_name = {}
Line 76: # Store a reference so we can look up the params


PS7, Line 407: ret[1]
this is very opaque. can you use a proper name?


-- 
To view, visit https://gerrit.ovirt.org/67457
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5b901fac8df23aed958fb9509008f9cfaee648c3
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik 
Gerrit-Reviewer: Milan Zamazal 
Gerrit-Reviewer: Yaniv Kaul 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org