Yandex launches YaFF: a zero-copy Protobuf alternative with near struct speed
Yandex has open-sourced YaFF, a zero-copy wire format for Protobuf that promises server-side reads nearly as fast as raw C++ structs. Released under Apache 2.0 and currently available as a C++ library (v0.1.0), YaFF preserves the original .proto file as the single source of truth while only changing the physical memory layout. Benchmark results show the Flat Layout reading hot data about 3.8 times faster than FlatBuffers and within 1.2 times of a raw struct. The project targets high-load backends where Protobuf parsing can consume double-digit CPU percentages, equating to thousands of cores at scale.
A drop-in alternative, not a replacement
YaFF is not meant to replace Protobuf but to serve as an alternative wire format that maintains Protobuf semantics. The same .proto schema generates a proto-style C++ API, enabling zero-copy reads directly from the buffer. For less performance-sensitive paths, the wire format can still be parsed back into Protobuf messages, allowing incremental adoption by introducing YaFF in one hot path while keeping the rest on Protobuf.
Four layouts to balance speed and flexibility
YaFF offers four physical layouts to trade off read speed against schema flexibility. Fixed uses a plain packed struct with no header for frozen schemas, Flat adds a two-byte header for restricted evolution, Sparse uses a meta table for unrestricted evolution, and Dynamic (the default) switches between Flat and Sparse at runtime. Benchmarks on an AMD EPYC 7713 with Clang 20.1.8 show the Flat Layout reading in 9.79 nanoseconds—about 3.8 times faster than FlatBuffers and roughly 22 times faster than Protobuf—while staying within 1.2 times of a raw struct.
Built for production, tested in Yandex’s ad system
YaFF powers parts of Yandex’s advertising recommendation system, where it reports 10–20% CPU savings at production scale. The library ships with a reproducible benchmark suite and targets server-side runtimes, offering teams a way to reduce parsing overhead without abandoning Protobuf schemas or tooling.
Source: MarkTechPost. AI-assisted editorial synthesis — TechnoExpress.

