Public
Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md


CI License Telegram Telegram

YaFF

Documentation

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.

Key Features

  • Zero-Copy Speed — Eliminates parsing entirely with mmap-compatible layouts.
  • Adaptive Layouts — Allows explicit configuration or runtime adjustment to manage tradeoffs between speed, memory overhead, and schema flexibility.
  • Protobuf Native — Uses existing .proto files and respects Protobuf semantics.
  • Incremental Adoption — Emulates standard proto interfaces and provides two-way message conversion for easy module-by-module integration.

Quick Start

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.

Roadmap

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:

  • Columnar Layout — Compact representation for large repeated fields, optimized for analytics and ML pipelines.
  • Automated Adaptivity — Layout selection driven automatically by data analysis or via profile-guided modes.
  • Multi-Language Bindings — Extending zero-copy data access to languages beyond C++.

Integration Guide

YaFF can be added to a project in two ways:

  • CMake — build and install YaFF, then use find_package
  • Conan — build YaFF into the local Conan cache, then declare it as a dependency

Both methods expose the same set of CMake targets and the yaff_generate() helper function.

Available CMake Targets

TargetTypeWhen to use
yaff::coreINTERFACE libraryAlways — provides all runtime headers (include/yaff/*.h)
yaff::protoSTATIC libraryWhen reading/writing Protobuf-backed YaFF messages
yaff::protoc_pluginExecutableUsed 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.

Contributing

Contributions are welcome! See the contributor's guide for how to report issues and submit pull requests.

License

This project is licensed under the Apache 2.0 License (Apache-2.0). Apache License 2.0.

关于 About

YaFF is a high-performance C++ serialization library that provides a zero-copy wire format for the Protobuf ecosystem.
c-plus-plusflatbuffersmmapperformanceprotobufserializationzero-copy

语言 Languages

C++94.8%
CMake4.1%
Python1.0%
C0.1%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
2
Total Commits
峰值: 1次/周
Less
More

核心贡献者 Contributors