[libcxx-commits] [libcxx] [libc++][string] Add constexpr initialization stress test (PR #184723)
Aaron Ballman via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jun 23 05:51:32 PDT 2026
AaronBallman wrote:
> I don't think we should go ahead with this, or with #184724. It's not that I don't like constexpr efficiency, but this seems to be making a pretty arbitrary change to raise the limit from some arbitrary point to another arbitrary point. This does not meaningfully improve or document the guarantees provided by the library (and in fact I don't think it makes sense to aim for a specific guarantee in this domain).
>
> As @AaronBallman said in [#184724 (comment)](https://github.com/llvm/llvm-project/pull/184724#issuecomment-4092286596), these steps are arbitrary and I don't think it makes sense for libc++ to try to provide guarantees about something so arbitrary.
The steps are arbitrary but I think there might be something here worth testing -- I think we want to know when the implementation has an unexpected jump in the number of steps it takes to complete a task. e.g., if string init took 1000 steps yesterday and takes 10000 steps today, we want to validate that those extra steps are expected and reasonable rather than a regression. But this feels a lot like any other performance regression testing, just happening at compile time rather than at runtime.
https://github.com/llvm/llvm-project/pull/184723
More information about the libcxx-commits
mailing list