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

Use postcard to serialize cookie data #81

Merged
merged 2 commits into from
Aug 24, 2023
Merged

Use postcard to serialize cookie data #81

merged 2 commits into from
Aug 24, 2023

Conversation

djc
Copy link
Owner

@djc djc commented Aug 24, 2023

@cycraig want to review this?

postcard has a documented wire format and should serialize to smaller
messages, so it seems like a more attractive option.
@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (fa9156d) 57.32% compared to head (bf81d65) 57.32%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #81    /-   ##
=======================================
  Coverage   57.32%   57.32%           
=======================================
  Files           7        7           
  Lines        1378     1378           
=======================================
  Hits          790      790           
  Misses        588      588           
Files Changed Coverage Δ
mendes/src/cookies.rs 76.47% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@cycraig cycraig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong opinion on serialization formats but some benchmarks show MessagePack (popular and similarly well-specced) to be smaller for fewer fields, but a bit slower. I only bring it up since the serialization format is a breaking change.

I see postcard does better in benchmarks for strings though. Overall postcard does seem better than bincode in almost every respect (maintenance, specification, size, speed), so should be fine.

@djc
Copy link
Owner Author

djc commented Aug 24, 2023

I think https://github.com/djkoloski/rust_serialization_benchmark is the definitive benchmark right now. From that data, it looks like there's not a big difference on the size axis between MessagePack and postcard. I like that postcard is tightly scoped, works within the serde data model and appears to be well-documented -- I think it will serve us well.

@djc djc merged commit 2395add into main Aug 24, 2023
11 checks passed
@delete-merged-branch delete-merged-branch bot deleted the postcard branch August 24, 2023 12:38
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 this pull request may close these issues.

2 participants