From Dan Kenigsberg <dan...@redhat.com>:

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

real    8m26.956s
user    8m26.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

real    0m3.010s
user    0m2.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 <mpoled...@redhat.com>
---
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 <mpoled...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpoled...@redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzama...@redhat.com>
Gerrit-Reviewer: Yaniv Kaul <yk...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to