Use a dictionary for string lookup, which is initialized the first time the constructor is called.
This is more efficient than just iterating of the string table.
Unfortunately it's still not as fast as the original version (where all the string comparisons are inlined into the constructor) for enums with < 100 strings.
But this will improve once we can pass the string and string table as borrowed parameters and we can reduce the ARC overhead.
Instead of inlining a series of string comparisons, we call a library function which does the string lookup on a table of static strings.
This reduces the code size of those initializers dramatically.
Performance wise it's slower than before, because the string comparisons are not inlined anymore.