[all-commits] [llvm/llvm-project] a12744: [libc++] Optimize ranges::swap_ranges for vector<b...

Peng Liu via All-commits all-commits at lists.llvm.org
Tue Mar 4 14:15:58 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a12744ff05bbc2d0de711afb8b3a1c7a03a33914
      https://github.com/llvm/llvm-project/commit/a12744ff05bbc2d0de711afb8b3a1c7a03a33914
  Author: Peng Liu <winner245 at hotmail.com>
  Date:   2025-03-04 (Tue, 04 Mar 2025)

  Changed paths:
    M libcxx/docs/ReleaseNotes/21.rst
    M libcxx/include/__algorithm/swap_ranges.h
    M libcxx/include/__bit_reference
    A libcxx/test/benchmarks/algorithms/swap_ranges.bench.cpp
    M libcxx/test/std/algorithms/alg.modifying.operations/alg.swap/ranges.swap_ranges.pass.cpp
    M libcxx/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp

  Log Message:
  -----------
  [libc++] Optimize ranges::swap_ranges for vector<bool>::iterator (#121150)

This PR optimizes the performance of `std::ranges::swap_ranges` for
`vector<bool>::iterator`, addressing a subtask outlined in issue #64038.
The optimizations yield performance improvements of up to **611x** for
aligned range swap and **78x** for unaligned range swap comparison.
Additionally, comprehensive tests covering up to 4 storage words (256
bytes) with odd and even bit sizes are provided, which validate the
proposed optimizations in this patch.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list