[all-commits] [llvm/llvm-project] d81482: [libc++] Decrease instantiation cost of __constexp...

Nikolas Klauser via All-commits all-commits at lists.llvm.org
Tue Feb 4 08:12:57 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d8148244e9be9d4c7b12abbdbf275d80d5ba57a5
      https://github.com/llvm/llvm-project/commit/d8148244e9be9d4c7b12abbdbf275d80d5ba57a5
  Author: Nikolas Klauser <nikolasklauser at berlin.de>
  Date:   2025-02-04 (Tue, 04 Feb 2025)

  Changed paths:
    M libcxx/include/__string/constexpr_c_functions.h

  Log Message:
  -----------
  [libc++] Decrease instantiation cost of __constexpr_memmove (#125109)

Using `if constexpr` in `__constexpr_memmove` makes the instantiation
three times faster for the same type, since it avoids a bunch of class
instantiations and SFINAE for constexpr support that's never actually
used. Given that `__constexpr_memmove` is used quite a bit through
`std::copy` and is instantiated multiple times when just including
`<__string/char_traits.h>` this can provide a nice compile time speedup
for a very simple change.



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