]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
osd: optimize extent comparison in PrimaryLogPG
authorDongdong Tao <tdd21151186@gmail.com>
Fri, 22 Nov 2024 01:56:30 +0000 (10:56 +0900)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 12 Jan 2025 16:52:07 +0000 (17:52 +0100)
commit363f731d6a2407b5071e7e2c7e687583a06fd045
treea03e5fa9dc84c0e68342f4b550446a372baf1142
parent1932f5f744b60e192b1da3ff2947568e11cb52c2
osd: optimize extent comparison in PrimaryLogPG

Improve the performance of finish_extent_cmp by using bufferlist iterators
instead of array access operator[]. This change:

- Replaces O(N) array access with O(1) iterator operations

The original implementation used array access which has O(N) complexity
for each access in bufferlist (N being the number of buffers in a bufferlist).
The new version uses iterators which wprovide O(1) increment operations,
reducing the overall function complexity from O(M*N) to O(M) with M being the
length of the bufferlist.

Fixes: https://tracker.ceph.com/issues/69014
Signed-off-by: Dongdong Tao <dongdong.tao@canonical.com>
(cherry picked from commit 60797f6862f8387be2b09ad61e198a60c55383d5)
src/osd/PrimaryLogPG.cc