Repository navigation
Make serde dependency optional - #235
Merged
Merged
Conversation
Member
|
@bors-servo r+ |
Contributor
|
📌 Commit 7f50fe0 has been approved by |
Contributor
bors-servo
pushed a commit
that referenced
this pull request
Dec 5, 2019
Make serde dependency optional This crate (and deps) takes around 8s to compile on my machine. I checked and this is mostly serde, and without it, a full rebuild takes only 0.5s (again, on my machine). Many users of the crate will need serde, but some will not (e.g. I don't), and it's nice to get that compile time back for those that don't. It's on by default, for compatibility reasons, because default seems reasonable, and because I don't really care so long as I can disable it. I've named the feature `serde_support` instead of just `serde` in case you ever need to enable other crates or dep feature based on this (but perhaps I'm wrong and this would be possible anyway). I have tested locally, and added a CI smoke test to ensure it compiles without serde, but we don't run tests with out it (there are no serde-specific tests AFAICT, since the impls are indeed trivial, so the result would be the same anyway).
Contributor
|
☀️ Test successful - checks-travis |
|
Any chance to get this released @jdm? Got a use case that could really benefit from this. |
Member
|
https://crates.io/crates/string-cache/0.8.1 is up and includes this change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This crate (and deps) takes around 8s to compile on my machine. I checked and this is mostly serde, and without it, a full rebuild takes only 0.5s (again, on my machine).
Many users of the crate will need serde, but some will not (e.g. I don't), and it's nice to get that compile time back for those that don't. It's on by default, for compatibility reasons, because default seems reasonable, and because I don't really care so long as I can disable it.
I've named the feature
serde_supportinstead of justserdein case you ever need to enable other crates or dep feature based on this (but perhaps I'm wrong and this would be possible anyway).I have tested locally, and added a CI smoke test to ensure it compiles without serde, but we don't run tests with out it (there are no serde-specific tests AFAICT, since the impls are indeed trivial, so the result would be the same anyway).