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

Add default tag #131

Closed
erichCompSci opened this issue Dec 21, 2021 · 3 comments · Fixed by #152
Closed

Add default tag #131

erichCompSci opened this issue Dec 21, 2021 · 3 comments · Fixed by #152

Comments

@erichCompSci
Copy link
Contributor

@FL33TW00D Brought up a good point about defaults. I think that after the Option, Box switch is made we should try to add the Default tag to the generated structs, just like we do with Debug.

Thoughts?

@arlyon
Copy link
Owner

arlyon commented Jan 4, 2022

I agree. The fundamental tradeoff with this library is the size of the crate due to the massive volume of code that serde generates. This will obviously exacerbate things further, however for the minute, while we are using Box everywhere, I believe the tradeoff is worth it.

@arlyon
Copy link
Owner

arlyon commented Jan 4, 2022

Also, as a sidenote, I've been ill with COVID over the holidays so that big block of time I was hoping to spend on this disappeared :( but I have managed to clear out the pull request backlog and close some issues.

@arlyon
Copy link
Owner

arlyon commented Jan 30, 2022

I had some time to have a look at the implications of adding default to the code. My assumption was that this was negligible, but I wanted to get some data on it:

# current
> cargo expand --features runtime-async-std-surf | wc -l
730432
# with default
> cargo expand --features runtime-async-std-surf | wc -l
740943

Relatively minimal cost for a fairly major benefit imo

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