-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Enums with more than 256 variants #45
Comments
The main reason I limited enums to a 256 variants is because bitcode 0.6 requires calculating a histogram of all the variants of each enum while deserializing. With 256 variants a |
Perhaps an exception can be made for C-style enums, i.e. those that lack fields in their variants, which don't need a histogram. |
Is a |
Yes, because that would require iterating all 65536 elements to see which ones are non zero which is significant overhead. @finnbear does bring up a good point that histograms are only required non C-style enums so we could support |
Are there any plans on supporting enums larger than u8? I'm currently developing a language identifier that has 238 variants for the language codes and will probably surpass that amount in the future when more languages are added.
Also, I found the error a bit confusing
because it does not say anything about what is causing the error. So I did not know if it was a limitation from the language, the strum derives or the bitcode derives.
Thank you very much for your library. It was one of the main optimizations I did for my tool and was able to cut down the model loading time more than a half.
The text was updated successfully, but these errors were encountered: