]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: decrease number of `pvs` calls in `lvm list` 46967/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 20 Jun 2022 11:43:43 +0000 (13:43 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 5 Jul 2022 13:08:47 +0000 (15:08 +0200)
commite4d4278f1744ac8886edb32a1f91256e359c3188
tree41795e300db6fdf3fc96399249543f52c95c0dcc
parentc4a8e5d15163d588b25b033c25ae416600cffaa5
ceph-volume: decrease number of `pvs` calls in `lvm list`

current implementation of `List.create_report()` implies a lot of calls
to `pvs` process. This could be avoided.

current implementation:
```
>>> import timeit
>>> from ceph_volume.devices.lvm.listing import List
>>> timeit.timeit(List([]).main, number=1000)

...

93.03700458299136
```

new implementation:

```
>>> import timeit
>>> from ceph_volume.devices.lvm.listing import List
>>> timeit.timeit(List([]).main, number=1000)

...

62.16391600697534
```

In this example, it improves performance by ~30%

Fixes: https://tracker.ceph.com/issues/56127
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 1a38ea3b96dbe8fd2f2fca8ee9a501ef1423027f)
src/ceph-volume/ceph_volume/devices/lvm/listing.py