←back to thread

66 points chaokunyang | 1 comments | | HN request time: 0.198s | source

Serialization framework with some interesting numbers: 10-20x faster on nested objects than json/protobuf.

  Technical approach: compile-time codegen (no reflection), compact binary protocol with meta-packing, little-endian layout optimized for modern CPUs.

  Unique features that other fast serializers don't have:
  - Cross-language without IDL files (Rust ↔ Python/Java/Go)
  - Trait object serialization (Box<dyn Trait>)
  - Automatic circular reference handling
  - Schema evolution without coordination

  Happy to discuss design trade-offs.

  Benchmarks: https://fory.apache.org/docs/benchmarks/rust
Show context
seg_lol ◴[] No.45738254[source]
Why this over serialization free formats like CapnProto and Flatbuffers? If you want it to be compact, send it through zstd (with a custom dictionary).

I do really like that is broad support out of the box and looks easy to use.

For Python I still prefer using dill since it handles code objects.

https://github.com/uqfoundation/dill

replies(1): >>45742003 #
1. chaokunyang ◴[] No.45742003[source]
Apache Fory is also a drop-in replacement for pickle/cloudpickle, you can use it to serialize code object such as local function/Classes too.

https://github.com/apache/fory/tree/main/python#serialize-lo...

When serializing code objects, pyfory is 3× higher compression ratio compared cloudpickle

And pyfory also provide extra security audit capability to avoid maliciously deserialization data attack.