Skip to content

Stop instantiating parse_value in MapKey::deserialize_any #388

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

Merged
merged 1 commit into from
Dec 4, 2017
Merged

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Dec 4, 2017

The parse_value method is the most expensive method in serde_json in terms of compile time. Before this change, we were instantiating it twice for every derive(Deserialize) struct because every struct has two different Visitor impls -- one for the key type and one for the struct overall -- see https://serde.rs/deserialize-struct.html.

This improves compile time of json-benchmark in release mode by 20%. #313

The parse_value method is the most expensive method in serde_json in
terms of compile time. Before this change, we were instantiating it
twice for every derive(Deserialize) struct because every struct has
two different Visitor impls -- one for the key type and one for the
struct overall -- see https://serde.rs/deserialize-struct.html.

This improves compile time of json-benchmark by 20%.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant