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

Migrate to Postcard #869

Closed
Tracked by #873
sffc opened this issue Jul 20, 2021 · 2 comments · Fixed by #1211
Closed
Tracked by #873

Migrate to Postcard #869

sffc opened this issue Jul 20, 2021 · 2 comments · Fixed by #1211
Assignees
Labels
C-data-infra Component: provider, datagen, fallback, adapters S-small Size: One afternoon (small bug fix or enhancement) T-core Type: Required functionality
Milestone

Comments

@sffc
Copy link
Member

sffc commented Jul 20, 2021

We currently use Bincode for machine-readable data. Postcard is an alternative Serde plugin that trumpets the following goals:

  1. Design primarily for #![no_std] usage, in embedded or other constrained contexts
  2. Support a maximal set of serde features, so postcard can be used as a drop in replacement
  3. Avoid special differences in code between communication code written for a microcontroller or a desktop/server PC
  4. Be resource efficient - memory usage, code size, developer time, and CPU time; in that order
  5. Allow library users to customize the serialization and deserialization behavior to fit their bespoke needs

I have found previously that Postcard has a much smaller code size footprint than Bincode (#78 (comment), #866 (comment)), and others have found that it has big wins in memory usage (see here). The second analysis finds that the zlib data size of Postcard is a bit smaller and the CPU performance is a bit slower than Bincode (3.7533 ms for Postcard versus 3.4132 ms for Bincode).

Migrating to Postcard will also help us with the no_std efforts (see #812).

So I would like to propose that we migrate to Postcard for 0.4. If desired, we could keep Bincode around as a feature living alongside Postcard and JSON. I have a slight preference for removing Bincode, simply for the maintenance cost, but I can keep it if people want it.

@sffc sffc added T-core Type: Required functionality C-data-infra Component: provider, datagen, fallback, adapters S-small Size: One afternoon (small bug fix or enhancement) discuss-priority Discuss at the next ICU4X meeting labels Jul 20, 2021
@sffc sffc added this to the ICU4X 0.4 milestone Jul 20, 2021
@zbraniecki
Copy link
Member

I'm in support of that move. I second the slight preference to remove Bincode, since it doesn't serve any known additional purpose over Postcard.

@sffc sffc mentioned this issue Jul 21, 2021
7 tasks
@sffc
Copy link
Member Author

sffc commented Jul 22, 2021

2021-07-22:

Consensus: Adopt Postcard as proposed above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-data-infra Component: provider, datagen, fallback, adapters S-small Size: One afternoon (small bug fix or enhancement) T-core Type: Required functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants