YaFF is a high-performance C++ serialization library that provides a zero-copy wire format for the Protobuf ecosystem.
C++
533
16 commits
updated Oct 14, 2026
YaFF (Yet another Flat Format) is a high-performance C++ serialization library that provides a zero-copy wire format for the Protobuf ecosystem. While the .proto schema remains your single source of truth, YaFF changes the physical representation of data to eliminate runtime overhead. This provides performance-critical applications with direct, zero-parsing access through a proto-like interface, while allowing less performance-sensitive components to parse the wire format back into Protobuf messages.
YaFF shares the zero-copy foundations of FlatBuffers, but concentrates on server-side runtimes and adaptive layout strategies that bring read performance close to native C++ structs, preserving interoperability with Protobuf.
.proto files and respects Protobuf semantics.Working with YaFF feels close to Protobuf: you serialize a message and read fields back through a familiar interface, with no parsing step in between.
// Turn a Protobuf message into a zero-copy YaFF representation...
const auto buffer = yaff::Serialize<protoyaff::feed::FeedResponse>(proto);
// ...then access fields instantly with zero parsing overhead
const auto& response = yaff::ReadMessage<protoyaff::feed::FeedResponse>(buffer.Data());
std::string_view authorName = response.items(0).author().name();
See the full Quick Start guide for the complete walkthrough.
YaFF’s core design decouples schema definitions from the underlying physical memory layout. This separation allows the exact same data structures to support multiple runtime representations, enabling optimization for specific access patterns without changing the source schema.
YaFF is under active development. Planned and in-progress work includes:
YaFF can be added to a project in two ways:
find_packageBoth methods expose the same set of CMake targets and the yaff_generate() helper function.
| Target | Type | When to use |
|---|---|---|
yaff::core | INTERFACE library | Always — provides all runtime headers (include/yaff/*.h) |
yaff::proto | STATIC library | When reading/writing Protobuf-backed YaFF messages |
yaff::protoc_plugin | Executable | Used internally by yaff_generate(); not linked by consumers |
Most applications only need yaff::core and yaff::proto.
For step-by-step integration instructions see docs/integration.md.
Contributions are welcome! See the contributor's guide for how to report issues and submit pull requests.
This project is licensed under the Apache 2.0 License (Apache-2.0). Apache License 2.0.
2,812 followers · starred Jun 2026
1,256 followers · starred Jun 2026
629 followers · starred Jun 2026
209 followers · starred Jun 2026
YaFF is a high-performance C++ serialization library that provides a zero-copy wire format for the Protobuf ecosystem.
C++
533
16 commits
updated Oct 14, 2026
YaFF (Yet another Flat Format) is a high-performance C++ serialization library that provides a zero-copy wire format for the Protobuf ecosystem. While the .proto schema remains your single source of truth, YaFF changes the physical representation of data to eliminate runtime overhead. This provides performance-critical applications with direct, zero-parsing access through a proto-like interface, while allowing less performance-sensitive components to parse the wire format back into Protobuf messages.
YaFF shares the zero-copy foundations of FlatBuffers, but concentrates on server-side runtimes and adaptive layout strategies that bring read performance close to native C++ structs, preserving interoperability with Protobuf.
.proto files and respects Protobuf semantics.Working with YaFF feels close to Protobuf: you serialize a message and read fields back through a familiar interface, with no parsing step in between.
// Turn a Protobuf message into a zero-copy YaFF representation...
const auto buffer = yaff::Serialize<protoyaff::feed::FeedResponse>(proto);
// ...then access fields instantly with zero parsing overhead
const auto& response = yaff::ReadMessage<protoyaff::feed::FeedResponse>(buffer.Data());
std::string_view authorName = response.items(0).author().name();
See the full Quick Start guide for the complete walkthrough.
YaFF’s core design decouples schema definitions from the underlying physical memory layout. This separation allows the exact same data structures to support multiple runtime representations, enabling optimization for specific access patterns without changing the source schema.
YaFF is under active development. Planned and in-progress work includes:
YaFF can be added to a project in two ways:
find_packageBoth methods expose the same set of CMake targets and the yaff_generate() helper function.
| Target | Type | When to use |
|---|---|---|
yaff::core | INTERFACE library | Always — provides all runtime headers (include/yaff/*.h) |
yaff::proto | STATIC library | When reading/writing Protobuf-backed YaFF messages |
yaff::protoc_plugin | Executable | Used internally by yaff_generate(); not linked by consumers |
Most applications only need yaff::core and yaff::proto.
For step-by-step integration instructions see docs/integration.md.
Contributions are welcome! See the contributor's guide for how to report issues and submit pull requests.
This project is licensed under the Apache 2.0 License (Apache-2.0). Apache License 2.0.
2,812 followers · starred Jun 2026
1,256 followers · starred Jun 2026
629 followers · starred Jun 2026
209 followers · starred Jun 2026