[all-commits] [llvm/llvm-project] 2bf91d: [libc++] Use char_traits::copy while inserting whe...

Nikolas Klauser via All-commits all-commits at lists.llvm.org
Thu Jul 18 09:05:29 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2bf91db0c743f041c9f83609399f75654c07445a
      https://github.com/llvm/llvm-project/commit/2bf91db0c743f041c9f83609399f75654c07445a
  Author: Nikolas Klauser <nikolasklauser at berlin.de>
  Date:   2024-07-18 (Thu, 18 Jul 2024)

  Changed paths:
    M libcxx/include/string

  Log Message:
  -----------
  [libc++] Use char_traits::copy while inserting when possible (#97201)

This reduces the number of asm lines from 707 to 519 for this snippet:
```c++
auto test(std::string& str, const char* begin, const char* end) {
  str.insert(str.begin(), begin, end);
}
```
While that's not a performance metric, I've never seen a use of `memcpy`
result in a performance regression for any realistic usage.



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