r/cpp • • Feb 18 '26

Apache Fory C++: Fast Serialization with Shared/Circular Reference Tracking, Polymorphism, Schema Evolutionn and up to 12x Faster Than Protobuf

We just released Apache Fory Serialization support for c++:

https://fory.apache.org/blog/fory_cpp_blazing_fast_serialization_framework

Highlights:

  1. Automatic idiomatic cross-language serializaton: no adapter layer, serialize in C++, deserialize in Python.
  2. Polymorphism via smart pointers: Fory detects std::is_polymorphic<T> automatically. Serialize through a shared_ptr<Animal>, get a Dog back.
  3. Circular/shared reference tracking: Shared objects are serialized once and encoded as back-references. Cycles don't overflow the stack.
  4. Schema evolution: Compatible mode matches fields by name/id, not position. Add fields on one side without coordinating deployments.
  5. IDL compiler (optional): foryc ecommerce.fdl --cpp_out ./gen generates idiomatic code for every language from one schema. Generated code can be used as domain objects directly
  6. 6. Row format: O(1) random field access by index, useful for analytics workloads where you only read a few fields per record.

Throughput vs. Protobuf: up to 12x depending on workload.

GitHub: https://github.com/apache/fory

C++ docs: https://fory.apache.org/docs/guide/cpp

I’d really like critical feedback on API ergonomics, and production fit.

85 Upvotes

27 comments sorted by

View all comments

Show parent comment

1

u/Shawn-Yang25 Feb 20 '26

The  data encoded by fory can be different, we use a hybrid latin1/utf16/utf8 encoding for string. for rsut, the encoded string will always use utf8, but some language may use utf16 instead. But we can provide an option to enforce utf8 encoding for string , then the encoded bytes will be same