Optimize number of comparisons for heap/heapsort implementaion
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 9 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | bcachefs: Optimize eytzinger0_sort() using bottom-up heapsortfs/ | +30 | 0 replies | |
| 2/5 | bcachefs: Introduce parent function for sort_cmp_size()fs/ | +7 | 3 replies | |
| 3/5 | bcachefs: Optimize sort_cmp_size() using bottom-up heapsortfs/ | +35 | 0 replies | |
| 4/5 | bcachefs: Optimize number of comparisons in heap_sift_downfs/ | +13 | 0 replies | |
| 5/5 | bcache: Optimize number of comparisons in heap_siftdrivers/ | +13 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/5] Optimize number of comparisons for heap/heapsort implementaion
Hello,
The existing implementations of heap/heapsort follow the conventional textbook approach, where each heapify operation requires approximately 2*log2(n) comparisons. In this series, I introduce a bottom-up variant that reduces the number of comparisons during heapify operations to approximately log2(n), while maintaining the same number of swap operations.
Thanks,
Kuan-Wei
Kuan-Wei Chiu (5):
bcachefs: Optimize eytzinger0_sort() using bottom-up heapsort
bcachefs: Introduce parent function for sort_cmp_size()
bcachefs: Optimize sort_cmp_size() using bottom-up heapsort
bcachefs: Optimize number of comparisons in heap_sift_down
bcache: Optimize number of comparisons in heap_sift
drivers/md/bcache/util.h | 23 +++++---- fs/bcachefs/util.c | 109 ++++++++++++++++++++++++++------------- fs/bcachefs/util.h | 23 +++++---- 3 files changed, 98 insertions(+), 57 deletions(-)
Signature · 1 line
2.25.1