[all-commits] [llvm/llvm-project] 61a8d4: [libc++] Optimize std::swap of locales (#209760)

Nikolas Klauser via All-commits all-commits at lists.llvm.org
Tue Aug 4 05:08:49 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 61a8d42409f596def8befa1350f79609de08027c
      https://github.com/llvm/llvm-project/commit/61a8d42409f596def8befa1350f79609de08027c
  Author: Nikolas Klauser <nikolasklauser at berlin.de>
  Date:   2026-08-04 (Tue, 04 Aug 2026)

  Changed paths:
    M libcxx/include/__locale
    M libcxx/modules/std/locale.inc
    R libcxx/test/benchmarks/locale/ctype.bench.cpp
    R libcxx/test/benchmarks/locale/num_get.bench.cpp
    R libcxx/test/benchmarks/locale/num_put.bench.cpp
    A libcxx/test/benchmarks/text/localization/ctype.bench.cpp
    A libcxx/test/benchmarks/text/localization/locale.bench.cpp
    A libcxx/test/benchmarks/text/localization/num_get.bench.cpp
    A libcxx/test/benchmarks/text/localization/num_put.bench.cpp
    A libcxx/test/std/localization/locales/locale/locale.nonmembers/swap.pass.cpp

  Log Message:
  -----------
  [libc++] Optimize std::swap of locales (#209760)

Currently we copy construct `locale`s whenever we swap, which is quite
expensive for locales since that does atomic increments and decrements.
We can just swap the pointers instead.



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