Skip to content
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

Performance Issue on Large enums #13

Closed
anlumo opened this issue Sep 30, 2019 · 1 comment
Closed

Performance Issue on Large enums #13

anlumo opened this issue Sep 30, 2019 · 1 comment

Comments

@anlumo
Copy link

anlumo commented Sep 30, 2019

#[derive(TryFromPrimitive)]

takes about two minutes on my machine for an enum with ~6700 entries on every compile (even when the module it's in hasn't changed).

With RUSTFLAGS="-Ztime" set, the log output shows that the time is spent in the expand crate step.

@illicitonion
Copy link
Owner

This has since been fixed in one of our upstream dependencies (proc-macro2).

I've just published 0.4.2 of num_enum which should use that dependency - if you cargo update you should start seeing much better performance :)

Thanks for the bug report, it was an interesting one to dive into, and see others dive into as well, and the fix should hopefully help the wider rust ecosystem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants