AllTopicsTodayAllTopicsToday
Notification
Font ResizerAa
  • Home
  • Tech
  • Investing & Finance
  • AI
  • Entertainment
  • Wellness
  • Gaming
  • Movies
Reading: Yandex Open-Sources YaFF: A Zero-Copy Wire Format for Protobuf With Near-Struct Read Speed
Share
Font ResizerAa
AllTopicsTodayAllTopicsToday
  • Home
  • Blog
  • About Us
  • Contact
Search
  • Home
  • Tech
  • Investing & Finance
  • AI
  • Entertainment
  • Wellness
  • Gaming
  • Movies
Have an existing account? Sign In
Follow US
©AllTopicsToday 2026. All Rights Reserved.
AllTopicsToday > Blog > AI > Yandex Open-Sources YaFF: A Zero-Copy Wire Format for Protobuf With Near-Struct Read Speed
AI

Yandex Open-Sources YaFF: A Zero-Copy Wire Format for Protobuf With Near-Struct Read Speed

AllTopicsToday
Last updated: June 20, 2026 10:33 am
AllTopicsToday
Published: June 20, 2026
Share
SHARE

TLDR

YaFF is an open supply zero-copy wire format for Protobuf from Yandex (Apache 2.0 (at present C++, v0.1.0)). .proto information stay a supply of reality. Solely the bodily reminiscence structure modifications. In Yandex benchmarks, Flat Structure reads sizzling information roughly 3.8 instances sooner than FlatBuffers and inside 1.2 instances sooner than uncooked C++ buildings. 4 layouts (mounted, flat, sparse, and dynamic) commerce learn velocity for schema flexibility. Default is dynamic. YaFF runs on an advert suggestion system and studies 10-20% CPU financial savings at manufacturing scale. Deployment will happen in levels. Carry out a bidirectional Protobuf transformation on the sting and drop it into one sizzling path.

Yandex open sourced YaFF (One more Flat Format) with Apache 2.0. This can be a excessive efficiency C++ serialization library. YaFF offers a zero-copy wire format to the Protobuf ecosystem. The .proto file stays the one supply of reality. This format solely modifications how the information is organized in reminiscence. It focuses on server-side runtimes.

What’s YaFF?

YaFF will not be a substitute for Protobuf. That is another wire format for Protobuf messages. The identical .proto schema generates a proto-like C++ API. Studying doesn’t require a parsing step, so the fields are retrieved straight from the buffer. Even much less performance-sensitive code can parse the wire format again into Protobuf messages. This bidirectional conversion makes module-by-module deployment sensible. Deploy YaFF on one sizzling path and depart the remaining in Protobuf.

Goal downside

Protobuf parsing can devour double-digit percentages of CPU on closely loaded backends. At scale, it maps to 1000’s of bodily cores. A well-liked zero-copy choice is FlatBuffers, additionally from Google. Nevertheless, FlatBuffers will not be a Protobuf drop-in, so it’s essential to keep a separate schema and transformation layer. Semantically incompatible with Protobuf. Migrations imply duplicate schemas, totally different schema growth guidelines, and hand-written subject converters. Many groups conclude that it’s not price the associated fee. YaFF goals to handle that hole: zero-copy reads that protect Protobuf semantics.

How structure works

The structure determines how messages are saved within the buffer. Solely the bodily illustration modifications; the schema and generated interfaces stay unchanged. YaFF ships with 4 layouts. Mounted plain packed structs with out headers and frozen schemas. Flat provides a 2-byte header and helps schema evolution. Sparse corresponds to fields via meta tables and suits into sparse schemas. Dynamic is the default, and also you select flat or sparse at runtime. Use Flat whereas the schema permits, and change to Sparse when evolution breaks flat alignment.

Structure Learn Entry Per Message Overhead Schema Evolution Greatest Use Mounted 1 Learn, 0 Department 0 Bytes Freeze Small Inline Primitives Flat 2 Reads, 1 Department 2 Bytes Restricted (Kind Preserving) Dense, Sizzling Knowledge Sparse 4 Reads, 2 Branches 6 Bytes Unrestricted Sparse Schema, Free Evolution Dynamic (Default) Runtime Flat or Sparse 2 or 6 bytesUnrestrictedGeneral Software Logic

benchmark

Yandex ships a collection of reproducible benchmarks constructed utilizing google/benchmark in launch builds. The numbers under are the median nanoseconds per learn on an AMD EPYC 7713 with Clang 20.1.8. The decrease the velocity, the sooner it’s. For the new hierarchy, the flat structure learn time is 9.79 ns. FlatBuffers requires 37.30 ns and Protobuf requires 219.35 ns. The baseline for uncooked C++ buildings is 8.14 ns. Subsequently, Flat Structure reads about 3.8 instances sooner than FlatBuffers and about 22 instances sooner than Protobuf. It’s inside 1.2 instances the uncooked construction.

Format learn time (ns) slowdown and uncooked structRaw C++ struct8.141.0×YaFF Flat Layout9.791.2×YaFF Sparse Layout21.232.6×FlatBuffers37.304.6×Protobuf219.3526.9×
Median ns per learn, tiered/sizzling/no chain cache. Supply: https://yaff.tech/docs/en/benchmarks/entry

Observe: Absolutely the quantity is dependent upon the host CPU and reminiscence. It’s anticipated that the ratio between codecs will likely be maintained throughout the {hardware}.

Compiler aliasing particulars

Each FlatBuffers and YaFF learn fields by reinterpreting uncooked reminiscence because the goal kind. With such puns, TBAA lacks robust sufficient details. Subsequently, LLVM’s alias evaluation reverts to a conservative MayAlias ​​resolution. On this case, the compiler can’t show that it’s protected to reuse repeated accesses. Writing root.intermediate().leaf().a() twice retraces the tree every time. YaFF provides annotations to the generated code that inform the compiler that it’s protected to reuse. YaFF’s generated code annotations typically assist the compiler reuse entry chains so long as the related reminiscence will not be modified between reads. YaFF caches entry chains by itself until you write something to reminiscence between reads.

Good place: Use case

YaFF targets programs that management each producers and shoppers. Suggestion and advert serving backends are best suited. YaFF runs on an advert suggestion system and studies 10-20% CPU financial savings at manufacturing scale, based on Yandex. Reminiscence-mapped indexes are an excellent second alternative. A number can maintain tens of gigabytes of native information. These mmapable indexes survive service restarts with out reparsing. Search indexes, characteristic shops, and feed companies share read-heavy profiles. The deliberate columnar structure targets analytics and ML pipelines with massive repeating fields. YaFF is extra compact than FlatBuffers, which helps with caching habits.

check out the code

The learn path displays Protobuf with out the parse step.

#embrace “feed.pb.h” // Generated by protoc #embrace “feed.yaff.h” // Generated by yaff_generate() // 1. Serialize the prevailing Protobuf message right into a YaFF buffer. feed::FeedResponse proto = LoadFeedResponse(); const autobuffer = yaff::Serialize(proto); // 2. Learn the sphere straight from the buffer. There aren’t any evaluation steps. const auto& response = yaff::ReadMessage(buffer.Knowledge()); for (const auto& merchandise : response.objects()) { std::string_view title = merchandise.title(); std::string_view writer = merchandise.writer().identify(); // Empty if no writer is ready } // 3. If the buyer wants the parsed message, convert it again to Protobuf. feed::FeedResponse has been restored. response.ParseTo(restore);

Add YaFF via CMake (find_package) or Conan. Code era runs protobuf_generate() after which yaff_generate(). The generated YaFF varieties reside within the protoyaff:: namespace. Most initiatives solely hyperlink yaff::core and yaff::proto.

useful resource:

Try our GitHub repository and documentation.

Simplifying Data Integration for Long-Context LLMs
Katy Perry Didn’t Attend the Met Gala, But AI Made Her the Star of the Night
How to Run AI Models Locally (2025): Tools, Setup & Tips
Discussing Decision Trees: What Makes a Good Split?
OpenAI in talks with Amazon about investment could top $10 billion
Share This Article
Facebook Email Print
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Follow US

Find US on Social Medias
FacebookLike
XFollow
YoutubeSubscribe
TelegramFollow

Weekly Newsletter

Subscribe to our newsletter to get our newest articles instantly!
Popular News
Uykaito84 i1 cover detail.jpg
Gaming

Usagi Yojimbo gets a new writer, artist, and setting

AllTopicsToday
AllTopicsToday
November 20, 2025
Bridging the data gap in medical imaging with AI
Dwayne Johnson’s ‘Disciplined Approach’ Behind Weight Loss Transformation
The best Arts & Crafts properties for sale now
Megyn Kelly Trashes ‘Narcissistic Bully’ Blake Lively Over Subpoena
- Advertisement -
Ad space (1)

Categories

  • Tech
  • Investing & Finance
  • AI
  • Entertainment
  • Wellness
  • Gaming
  • Movies

About US

We believe in the power of information to empower decisions, fuel curiosity, and spark innovation.
Quick Links
  • Home
  • Blog
  • About Us
  • Contact
Important Links
  • About Us
  • Privacy Policy
  • Terms and Conditions
  • Disclaimer
  • Contact

Subscribe US

Subscribe to our newsletter to get our newest articles instantly!

©AllTopicsToday 2026. All Rights Reserved.
1 2
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?