[llvm-branch-commits] [libcxx] [libc++][string] Improve constexpr efficiency (PR #184724)
Vitaly Buka via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sat Oct 3 21:02:04 PDT 2026
vitalybuka wrote:
Sorry, I was travailing and didn't notices last comment @ldionne @philnik777
I'll reopen, and try one more, if it didn't convince you, feel free to close again.
> makes sense for libc++ to start trying to provide guarantees here.
Maybe guarantees are unnecessary, but it's as basic compile time optimization. Slightly less work for compiler.
Let say you have two options:
1. Implement in a way particular compiler take N seconds to compile.
2. Implement in a way particular compiler take N+M seconds to compile.
Same code, no other particular benefits in each approach, just use construction harder to precess by compiler.
Why not pick version 1 over 2?
I see the same situation here. That's it.
I see no disadvantage in landing this PR, code after is strictly better that before, not dramatically but better.
If we don't want guaranty, we can drop the test, and land it as best effort NFC.
https://github.com/llvm/llvm-project/pull/184724
More information about the llvm-branch-commits
mailing list