Skip to main content

Fory v0.16.0 Released

· 12 min read
Shawn Yang

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

Highlights

C# Serialization: First Release

Apache Fory 0.16.0 is the first release with official C# serialization support. The C# runtime targets modern .NET workloads and brings the same object graph, cross-language, and schema-evolution model available in other Fory runtimes.

Key capabilities:

  • High-performance binary serialization for .NET 8+ with source-generator-based serializers for [ForyObject] types
  • Cross-language mode with Java, Python, C++, Go, Rust, and JavaScript
  • Optional reference tracking for shared and circular object graphs
  • Compatible mode for schema evolution
  • Dynamic object payloads, custom serializers, and namespace/name registration APIs
  • ThreadSafeFory wrapper for concurrent service workloads
  • C# target support in the Fory IDL/compiler workflow

Quick Start

using Apache.Fory;

[ForyObject]
public sealed class User
{
public long Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? Email { get; set; }
}

Fory fory = Fory.Builder()
.Xlang(true)
.Compatible(true)
.Build();
fory.Register<User>(1);

byte[] payload = fory.Serialize(new User
{
Id = 1,
Name = "Alice",
Email = "alice@example.com",
});
User decoded = fory.Deserialize<User>(payload);

C# Benchmarks

Below are timing results (ns/op; lower is better) comparing Fory with Protobuf and Msgpack across representative data structures.

Data TypeOperationForyProtobufMsgpack
StructSerialize39.2121.566.0
StructDeserialize58.3180.1102.6
SampleSerialize269.2562.6339.6
SampleDeserialize175.61084.9531.8
MediaContentSerialize306.3434.7351.5
MediaContentDeserialize379.4718.8676.9
StructListSerialize136.1468.5266.9
StructListDeserialize221.1687.0488.5
SampleListSerialize1198.92811.91635.7
SampleListDeserialize791.55174.52629.2
MediaContentListSerialize1393.92199.41710.9
MediaContentListDeserialize1719.53373.13401.2

Serialized data sizes (bytes):

Data TypeForyProtobufMsgpack
Struct586155
Sample446460562
MediaContent365307479
StructList184315284
SampleList198023152819
MediaContentList153515502404

Benchmark details: https://fory.apache.org/docs/benchmarks/csharp/

Swift Serialization: First Release

Apache Fory 0.16.0 is also the first release with official Swift serialization support. The Swift implementation focuses on idiomatic API design, macro-based model serialization, cross-language compatibility, and strong support for object graph workloads.

Key capabilities:

  • High-performance serialization for Swift value and reference types
  • @ForyObject macro for zero-boilerplate model serialization
  • Cross-language protocol compatibility with Java, Python, C++, Go, Rust, and JavaScript
  • Compatible mode for schema evolution across versions
  • Dynamic value support for Any, AnyObject, any Serializer, and AnyHashable
  • Reference tracking for shared/circular graphs, including weak references on classes
  • Swift target support in the Fory IDL/compiler workflow

Quick Start

import Fory

@ForyObject
struct User: Equatable {
var name: String = ""
var age: Int32 = 0
}

let fory = Fory(xlang: true, trackRef: false, compatible: true)
fory.register(User.self, id: 1)

let input = User(name: "Alice", age: 30)
let data = try fory.serialize(input)
let output: User = try fory.deserialize(data)

Swift Benchmarks

Below are throughput results (ops/sec; higher is better) comparing Fory with Protobuf and Msgpack across representative data structures.

Data TypeOperationForyProtobufMsgpackFastest
StructSerialize9,727,9506,572,406141,248fory (1.48x)
StructDeserialize11,889,5708,584,51099,792fory (1.39x)
SampleSerialize3,496,3051,281,98317,188fory (2.73x)
SampleDeserialize1,045,018765,70612,767fory (1.36x)
MediaContentSerialize1,425,354678,54229,048fory (2.10x)
MediaContentDeserialize614,447478,29812,711fory (1.28x)
StructListSerialize3,307,9621,028,21024,781fory (3.22x)
StructListDeserialize2,788,200708,5968,160fory (3.93x)
SampleListSerialize715,734205,3803,361fory (3.48x)
SampleListDeserialize199,317133,4251,498fory (1.49x)
MediaContentListSerialize364,097103,7215,538fory (3.51x)
MediaContentListDeserialize103,42186,3311,529fory (1.20x)

Serialized data sizes (bytes):

Data TypeForyProtobufMsgpack
MediaContent365301524
MediaContentList153515202639
Sample446375737
SampleList198018903698
Struct586165
StructList184315338

Benchmark details: https://fory.apache.org/docs/benchmarks/swift/

Features

Bug Fix

Other Improvements

New Contributors