Skip to main content

Fory v0.13.0 Released

· 18 min read
Shawn Yang

The Apache Fory team is pleased to announce the 0.13.0 release. This is a major release that includes 217 PR from 19 distinct contributors. See the Install Page to learn how to get the libraries for your platform.

Highlights

  • Dynamic Trait Object Serialization for Rust
  • Shared/Circular ownership serialization for Rust
  • Schema Forward/Backward compatibilify for Rust
  • Drop-in Replacement for Python pickle: support local function/classes/__reduce__/__getstate__ serialization
  • Schema Forward/Backward compatibilify for Python dataclass
  • Support codegen for xlang mode in java
  • Primitive array compression using SIMD
  • Compact Row Codec for Row Format
  • Schema Forward/Backward compatibilify for Go
  • Ahead-of-time codegen for golang struct serialization

Rust: First Release Highlights

This is the first Apache Fory Rust release, delivering a complete, high‑performance serialization stack. If you build Rust services or libraries, you can now use Fory natively with strong typing, performance, and schema evolution.

  • Derive-based object graph serialization via #[derive(ForyObject)]
  • Polymorphism for trait objects: Box<dyn Trait>, Rc<dyn Trait>, Arc<dyn Trait>, plus dyn Any
  • Shared and circular reference tracking: Rc/Arc and RcWeak/ArcWeak
  • Forward/backward compatible schema evolution (Compatible mode)
  • Zero-copy Row format via #[derive(ForyRow)] with selective field access
  • Thread-safe and multi-thread capable serialization (context pool)
  • Broad collection support (e.g., VecDeque, LinkedList, BTreeMap, BTreeSet, BinaryHeap)

Quick start (minimal example):

use fory::{Fory, Error};
use fory::ForyObject;

#[derive(ForyObject, Debug, PartialEq)]
struct User {
name: String,
age: i32,
email: String,
}

fn main() -> Result<(), Error> {
let mut fory = Fory::default();
fory.register::<User>(1)?;

let user = User { name: "Alice".into(), age: 30, email: "alice@example.com".into() };
let bytes = fory.serialize(&user)?;
let decoded: User = fory.deserialize(&bytes)?;
assert_eq!(user, decoded);
Ok(())
}

Rust Benchmarks

Below are serialize throughput results (TPS; higher is better) comparing Fory with JSON and Protobuf across multiple datasets and sizes.

DatatypeSizeOperationFory TPSJSON TPSProtobuf TPSFastest
companysmallserialize10,063,906761,673896,620fory
companymediumserialize412,50733,83537,590fory
companylargeserialize9,183793880fory
ecommerce_datasmallserialize2,350,729206,262256,970fory
ecommerce_datamediumserialize59,9774,6995,242fory
ecommerce_datalargeserialize3,727266295fory
personsmallserialize13,632,5221,345,1891,475,035fory
personmediumserialize3,839,656337,610369,031fory
personlargeserialize907,85379,63191,408fory
simple_listsmallserialize27,726,9454,874,9574,643,172fory
simple_listmediumserialize4,770,765401,558397,551fory
simple_listlargeserialize606,06141,06144,565fory
simple_mapsmallserialize22,862,3693,888,0252,695,999fory
simple_mapmediumserialize2,128,973204,319193,132fory
simple_maplargeserialize177,84718,41918,668fory
simple_structsmallserialize35,729,59810,167,0458,633,342fory
simple_structmediumserialize34,988,2799,737,0986,433,350fory
simple_structlargeserialize31,801,5584,545,0417,420,049fory
system_datasmallserialize5,382,131468,033569,930fory
system_datamediumserialize174,24011,89614,753fory
system_datalargeserialize10,6718761,040fory

Note: Results depend on hardware, dataset, and implementation versions. See the Rust guide for how to run benchmarks yourself: https://github.com/apache/fory/blob/main/rust/benches/README.md

Python: Drop‑in Replacement for pickle

pyfory now acts as a high‑performance drop‑in replacement for pickle/cloudpickle, while keeping the same simple API and adding security and performance features.

  • Serialize any Python object in Python‑native mode (xlang=False): global/local functions, lambdas, global/local classes, instance/class/static methods
  • Honors Python hooks: __getstate__, __setstate__, __reduce__, __reduce_ex__
  • Reference tracking for shared/circular graphs with ref=True
  • Pickle protocol 5 out‑of‑band buffers for zero‑copy via pickle.PickleBuffer (NumPy, Pandas, etc.)
  • Security: strict=True for registration‑based safety and DeserializationPolicy for fine‑grained control
  • Threading: ThreadSafeFory for safe multi‑thread use
  • Familiar API: dumps/loads are aliases of serialize/deserialize

Quick start:

import pyfory

# Drop-in replacement for pickle/cloudpickle
fory = pyfory.Fory(xlang=False, ref=True, strict=False)

def make_multiplier(k):
def mul(x):
return k * x
return mul

binary = fory.dumps(make_multiplier(10))
assert fory.loads(binary)(3) == 30

Read more: Python Guide – https://fory.apache.org/docs/latest/python_serialization/

Features

Bug Fix

Other Improvements

New Contributors

Full Changelog: https://github.com/apache/fory/compare/v0.12.3...v0.13.0-rc2