Skip to content
프로젝트

소개

YaFF는 Protobuf 생태계를 위한 제로 카피 와이어 포맷을 제공하는 고성능 C++ 직렬화 라이브러리입니다.

개발 도구

이 수치를 측정하는 방법

What you can do

  • 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.

측정된 스타 증가

in 24h
0
in 7 days
+3
in 15 days
+6
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original


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

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.

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.

관련 프로젝트 살펴보기

불러오는 중…