-
Notifications
You must be signed in to change notification settings - Fork 183
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
Making DateTime data zero-copy #1550
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, probably need a data regen for zeromap
I did, which is why |
the zeromaps are a little bit less efficient than litemaps, serialization-wise, but i'm surprised it adds up to that much |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Post-submit review (please follow the CONTRIBUTING.md please and hold off on merging until there are no more pending reviews)
@@ -56,24 +59,28 @@ macro_rules! symbols { | |||
($name: ident { $element: ident: Option<$ty: ty>, $($tokens: tt)+ } -> ($($members:tt)*)) => { | |||
symbols!($name { $($tokens)* } -> ( | |||
$($members)* | |||
#[cfg_attr(feature = "provider_serde", serde(borrow))] | |||
pub $element: Option<$ty>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: serde(borrow) does not always work through options. You may need deserialize_with
.
This is a known issue that dtolnay does not intend to fix (see serde-rs/serde#2016)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests to verify that the data being deserialized is actually being borrowed. #[serde(borrow)]
is weird and it sometimes works and sometimes doesn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh i was looking for Option
but didn't notice this one since it's in a macro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably get a clippy lint that warns about serde(borrow) on option fields
I would also like to know where the 81 KB comes from. This is a destabilizing change and it should not have been merged when 0.5 is days-to-hours away. |
This reverts commit 405b9fd.
* Fixing Option borrows * Custom Option<Cow<str>> deserializer * Revert "Custom Option<Cow<str>> deserializer" This reverts commit a69941c. * Serde utils in icu_provider * Removing serde_with dep * fmt and fix * Update provider/core/src/serde/borrow_de_utils.rs Co-authored-by: Shane F. Carr <shane@unicode.org> Co-authored-by: Shane F. Carr <shane@unicode.org>
No description provided.