Commit 60797f6
committed
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 <[email protected]>1 parent 3a35aeb commit 60797f6
1 file changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5798 | 5798 | | |
5799 | 5799 | | |
5800 | 5800 | | |
5801 | | - | |
5802 | | - | |
5803 | | - | |
5804 | | - | |
| 5801 | + | |
| 5802 | + | |
| 5803 | + | |
| 5804 | + | |
| 5805 | + | |
| 5806 | + | |
| 5807 | + | |
| 5808 | + | |
| 5809 | + | |
| 5810 | + | |
| 5811 | + | |
| 5812 | + | |
| 5813 | + | |
5805 | 5814 | | |
5806 | 5815 | | |
5807 | 5816 | | |
| |||
0 commit comments