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

Field atoms are duplicated in proc-macro #241

Closed
evnu opened this issue Sep 24, 2019 · 0 comments · Fixed by #257
Closed

Field atoms are duplicated in proc-macro #241

evnu opened this issue Sep 24, 2019 · 0 comments · Fixed by #257

Comments

@evnu
Copy link
Member

evnu commented Sep 24, 2019

Currently, the atoms generated for accessing fields in structs within ex_struct.rs, record.rs, etc., are duplicated for both encode and decode. This increases the amount of code generated considerably for larger structs. For example, when using cargo expand on https://github.com/evnu/NifIo/tree/macos-platform-hack, about 200 lines of code are generated for the atoms alone, which is 1/3 of the overall code. See the expanded code

This could be reduced by generating the atoms only once by generating a helper module and referencing that module from encoders and decoders. I would be up to give that a try, but #234 should be merged before this in order to avoid merge issues.

This was referenced Oct 16, 2019
@evnu evnu closed this as completed in #257 Oct 20, 2019
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.

1 participant