magic_enum works by walking all possible enumeration values from one-by-one in a wide range at compile time, instantiating a function template for each one so it can extract the __PRETTY_FUNCTION__ name, which is very slow. The C++26 feature just directly returns the vector of the named enumerators in one go, so it should be way faster.
They have a reference implementation on godbolt under clang, so you can play around with that. I did not try it yet.
Wow. I'm trying to make some of these template instantiations explicit on a large project I'm on as magic_enum is one of the largest contributors to our build-time.
It's nice to know I can just transition to C++26 to fix this.
They have a reference implementation on godbolt under clang, so you can play around with that. I did not try it yet.