[libcxx-commits] [libcxx] Speed up compilation of common uses of std::visit() by ~8x (PR #164196)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Fri Nov 28 01:26:09 PST 2025


https://github.com/philnik777 commented:

IIUC this basically fixes #62648. I'm not sure how to proceed here. Previously there were problems with this approach generating a lot of code, which is why it was reverted. This patch is a lot more conservative at least. I guess I'd really like if we had reflection here, since that would allow us to generate the perfect switch/case for any variant. I think I'd be fine with this as a temporary solution. I'd really like you to check compile time and code generation overhead of this though, since, as mentioned, this was a big problem previously.
Please run the variant benchmarks as well and share the results.

https://github.com/llvm/llvm-project/pull/164196


More information about the libcxx-commits mailing list