The older I get, the more convinced I am that I'd rather spend my life alone than be with someone who tries to change me or take away my freedom. I'd rather be alone than with the wrong person

reddit.com
u/aegismuzuz — 17 days ago
▲ 40 r/HPC+3 crossposts

YaFF, a zero-copy wire format for Protobuf schemas, Apache 2.0, C++

Hey everyone. Our team recently open-sourced YaFF (Yet Another Flat Format), a C++ serialization library that provides a zero-copy wire format for the Protobuf ecosystem

Why we built it:

In read-heavy, high-load paths, Protobuf parsing and deserialization can become a high CPU cost. Developers often look at FlatBuffers for zero-copy reads, but adopting it into an existing Protobuf-heavy codebase means dealing with separate schema/API layers and extra conversion logic.

What YaFF does:

YaFF keeps .proto files as the contract, but changes the physical representation of your data. You get close to native C++-structs while keeping your existing .proto files as your source of truth. You get zero-copy performance without abandoning the Protobuf ecosystem.

Some technical details:

  • written in C++ and designed for server-side runtimes
  • supports mmap compatable layouts for large local indexes and faster startup
  • mitigates accessor-chain overhead related to alias analysis with immutable buffers and gnu::pure annotations
  • easy to integrate via CMake or Conan

The project is still early (C++ only for now, other languages are on the roadmap). We're open to issues, pull requests, and any feedback from the community.

Source code and Quick Start: https://github.com/yandex/yaff

Happy to answer any technical questions in the comments!

u/aegismuzuz — 13 days ago