• bitcoinBitcoin(BTC)$63,533.001.28%
  • ethereumEthereum(ETH)$1,724.061.88%
  • tetherTether(USDT)$1.00-0.01%
  • binancecoinBNB(BNB)$585.481.91%
  • usd-coinUSDC(USDC)$1.000.00%
  • rippleXRP(XRP)$1.141.59%
  • solanaSolana(SOL)$71.444.48%
  • tronTRON(TRX)$0.3246810.67%
  • Figure HelocFigure Heloc(FIGR_HELOC)$1.032.13%
  • HyperliquidHyperliquid(HYPE)$70.725.35%
  • dogecoinDogecoin(DOGE)$0.0837401.73%
  • USDSUSDS(USDS)$1.000.00%
  • RainRain(RAIN)$0.0144530.07%
  • leo-tokenLEO Token(LEO)$9.560.43%
  • zcashZcash(ZEC)$471.814.51%
  • stellarStellar(XLM)$0.214338-1.05%
  • whitebitWhiteBIT Coin(WBT)$52.391.83%
  • cardanoCardano(ADA)$0.1624101.58%
  • moneroMonero(XMR)$317.94-0.20%
  • chainlinkChainlink(LINK)$7.921.22%
  • CantonCanton(CC)$0.151408-2.12%
  • USD1USD1(USD1)$1.00-0.01%
  • Ethena USDeEthena USDe(USDE)$1.00-0.02%
  • the-open-networkGram (prev. Toncoin)(GRAM)$1.610.32%
  • daiDai(DAI)$1.00-0.01%
  • bitcoin-cashBitcoin Cash(BCH)$198.241.58%
  • LABLAB(LAB)$12.13-23.44%
  • MemeCoreMemeCore(M)$2.84-3.05%
  • hedera-hashgraphHedera(HBAR)$0.0799431.02%
  • litecoinLitecoin(LTC)$44.231.30%
  • Circle USYCCircle USYC(USYC)$1.130.00%
  • suiSui(SUI)$0.721.15%
  • Global DollarGlobal Dollar(USDG)$1.000.00%
  • nearNEAR Protocol(NEAR)$2.140.83%
  • paypal-usdPayPal USD(PYUSD)$1.00-0.01%
  • shiba-inuShiba Inu(SHIB)$0.000005-0.23%
  • crypto-com-chainCronos(CRO)$0.0585560.91%
  • avalanche-2Avalanche(AVAX)$6.151.13%
  • tether-goldTether Gold(XAUT)$4,146.66-0.37%
  • BlackRock USD Institutional Digital Liquidity FundBlackRock USD Institutional Digital Liquidity Fund(BUIDL)$1.000.00%
  • BittensorBittensor(TAO)$230.661.55%
  • Ondo US Dollar YieldOndo US Dollar Yield(USDY)$1.130.02%
  • worldcoin-wldWorldcoin(WLD)$0.61-1.41%
  • pax-goldPAX Gold(PAXG)$4,151.86-0.11%
  • uniswapUniswap(UNI)$3.03-1.26%
  • World Liberty FinancialWorld Liberty Financial(WLFI)$0.0583490.16%
  • mantleMantle(MNT)$0.531.47%
  • AsterAster(ASTER)$0.642.40%
  • OndoOndo(ONDO)$0.346594-1.45%
  • Ripple USDRipple USD(RLUSD)$1.00-0.02%
TradePoint.io
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop
No Result
View All Result
TradePoint.io
No Result
View All Result

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

June 20, 2026
in AI & Technology
Reading Time: 5 mins read
A A
Yandex Open-Sources YaFF: A Zero-Copy Wire Format for Protobuf With Near-Struct Read Speed
ShareShareShareShareShare

TLDR

  • YaFF is Yandex’s open-source zero-copy wire format for Protobuf — Apache 2.0, currently C++, v0.1.0.
  • The .proto file stays the source of truth; only the physical memory layout changes.
  • On Yandex’s benchmarks, the Flat Layout reads hot data ~3.8× faster than FlatBuffers, within 1.2× of a raw C++ struct.
  • Four layouts — Fixed, Flat, Sparse, Dynamic — trade read speed for schema flexibility; Dynamic is the default.
  • YaFF runs in its advertising recommendation system, where it reports 10–20% CPU savings at production scale. 
  • Adoption is incremental: drop it into one hot path, with two-way Protobuf conversion at the edges.

Yandex has open-sourced YaFF (Yet another Flat Format) under Apache 2.0. It is a high-performance C++ serialization library. YaFF provides a zero-copy wire format for the Protobuf ecosystem. Your .proto file stays the single source of truth. The format only changes how data sits in memory. It concentrates on server-side runtimes.

What is YaFF 

YaFF is not a replacement for Protobuf. It is an alternative wire format for Protobuf messages. The same .proto schema generates a proto-like C++ API. Reads need no parsing step, so fields come straight from the buffer. Less performance-sensitive code can still parse the wire format back into Protobuf messages. That two-way conversion is what makes module-by-module adoption realistic. You introduce YaFF in one hot path and leave the rest on Protobuf.

YOU MAY ALSO LIKE

Nothing’s Budget Brand CMF Won’t Be Releasing A New Phone This Year

How to Build a Forecasting Pipeline with TimeCopilot Using Foundation Models and Automated Anomaly Detection

The Problem it Targets

Protobuf parsing can consume double-digit percentages of CPU in high-load backends. At scale, that maps to thousands of physical cores. The common  zero-copy option  is FlatBuffers, also from Google. But FlatBuffers is not a Protobuf drop-in and requires maintaining a separate schema and conversion layer. semantically incompatible with Protobuf. Migrating means duplicated schemas, different schema-evolution rules , and hand-written field converters. Many teams conclude the cost is not worth it. YaFF aims at that gap: zero-copy reads with Protobuf semantics preserved.

How the Layouts Work

A layout decides how a message is stored in the buffer. It changes only the physical representation, leaving the schema and generated interfaces unchanged. YaFF ships four layouts. Fixed is a plain packed struct with no header and a frozen schema. Flat adds a two-byte header and supports schema evolution. Sparse addresses fields through a meta table, fitting sparse schemas. Dynamic is the default and selects Flat or Sparse at runtime. It uses Flat while the schema permits, then switches to Sparse when evolution breaks flat alignment.

Layout Read access Per-message overhead Schema evolution Best for
Fixed 1 read, 0 branches 0 bytes Frozen Small inlined primitives
Flat 2 reads, 1 branch 2 bytes Restricted (type preservation) Dense, hot data
Sparse 4 reads, 2 branches 6 bytes Unrestricted Sparse schemas, free evolution
Dynamic (default) Flat or Sparse at runtime 2 or 6 bytes Unrestricted General application logic

Benchmark

Yandex ships a reproducible benchmark suite, built with google/benchmark in a Release build. The numbers below are median nanoseconds per read on an AMD EPYC 7713 with Clang 20.1.8. Lower is faster. In the hot hierarchical case, the Flat Layout reads in 9.79 ns. FlatBuffers needs 37.30 ns, and Protobuf needs 219.35 ns. The raw C++ struct baseline is 8.14 ns. So the Flat Layout reads about 3.8× faster than FlatBuffers here, and about 22× faster than Protobuf. It stays within 1.2× of the raw struct.

Format Read time (ns) Slowdown vs raw struct
Raw C++ struct 8.14 1.0×
YaFF Flat Layout 9.79 1.2×
YaFF Sparse Layout 21.23 2.6×
FlatBuffers 37.30 4.6×
Protobuf 219.35 26.9×
Median ns per read, hierarchical / hot / no chain caching. Source: https://yaff.tech/docs/en/benchmarks/access 

Note: The absolute numbers depend on the host CPU and memory. The ratios between formats are expected to hold across hardware.

The Compiler Aliasing Detail

FlatBuffers and YaFF both read fields by reinterpreting raw memory as the target type. That type-punning leaves TBAA without strong enough facts. So LLVM’s alias analysis falls back to a conservative MayAlias verdict. The compiler then cannot prove that repeated accesses are safe to reuse. Writing root.intermediate().leaf().a() twice re-walks the tree each time. YaFF adds annotations in its generated code that tell the compiler when reuse is safe. YaFF’s generated-code annotations can often help the compiler reuse the access chain, as long as the relevant memory is not modified between reads. As long as nothing writes to memory between reads, YaFF caches the access chain on its own.

Where It Fits: Use Cases

YaFF targets systems where you control both producer and consumer. Recommendation and ad-serving backends are the clearest fit. According to Yandex, YaFF runs in its advertising recommendation system, where it reports 10–20% CPU savings at production scale. Memory-mapped indexes are a second fit. A host can hold tens of gigabytes of local data. Those mmap-able indexes survive service restarts without re-parsing. Search indexes, feature stores, and feed services share that read-heavy profile. The planned Columnar Layout targets analytics and ML pipelines with large repeated fields. YaFF can also be more compact than FlatBuffers, which helps cache behavior.

A Look at the Code

The read path mirrors Protobuf, minus the parse step.

#include "feed.pb.h"     // generated by protoc
#include "feed.yaff.h"   // generated by yaff_generate()

// 1. Serialize an existing Protobuf message into a YaFF buffer.
feed::FeedResponse proto = LoadFeedResponse();
const auto buffer = yaff::Serialize(proto);

// 2. Read fields directly from the buffer. There is no parsing step.
const auto& response = yaff::ReadMessage(buffer.Data());
for (const auto& item : response.items()) {
    std::string_view title  = item.title();
    std::string_view author = item.author().name();  // empty if author is unset
}

// 3. Convert back to Protobuf when a consumer needs the parsed message.
feed::FeedResponse restored;
response.ParseTo(restored);

You add YaFF through CMake (find_package) or Conan. Code generation runs protobuf_generate() then yaff_generate(). Generated YaFF types live in the protoyaff:: namespace. Most projects only link yaff::core and yaff::proto.


Resources:

Check out the GitHub repository and Documentation.


Credit: Source link

ShareTweetSendSharePin

Related Posts

Nothing’s Budget Brand CMF Won’t Be Releasing A New Phone This Year
AI & Technology

Nothing’s Budget Brand CMF Won’t Be Releasing A New Phone This Year

June 20, 2026
How to Build a Forecasting Pipeline with TimeCopilot Using Foundation Models and Automated Anomaly Detection
AI & Technology

How to Build a Forecasting Pipeline with TimeCopilot Using Foundation Models and Automated Anomaly Detection

June 20, 2026
NVIDIA AI Introduce SpatialClaw: A Training-Free Agent That Treats Code as the Action Interface for Spatial Reasoning
AI & Technology

NVIDIA AI Introduce SpatialClaw: A Training-Free Agent That Treats Code as the Action Interface for Spatial Reasoning

June 19, 2026
VibeThinker-3B: A 3B Dense Reasoning Model Built on Qwen2.5-Coder-3B With the Spectrum-to-Signal Post-Training Pipeline
AI & Technology

VibeThinker-3B: A 3B Dense Reasoning Model Built on Qwen2.5-Coder-3B With the Spectrum-to-Signal Post-Training Pipeline

June 19, 2026
Next Post
Trump envoys head to Switzerland for potential Iran talks – Axios

Trump envoys head to Switzerland for potential Iran talks - Axios

Leave a Reply Cancel reply

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

Search

No Result
View All Result
Midjourney Built What?!?

Midjourney Built What?!?

June 18, 2026
Canada v Qatar: World Cup 2026 – live – The Guardian

Canada v Qatar: World Cup 2026 – live – The Guardian

June 18, 2026
Zimmer Biomet: Does Slow And Steady Still Win The Race?

Zimmer Biomet: Does Slow And Steady Still Win The Race?

June 16, 2026

About

Learn more

Our Services

Legal

Privacy Policy

Terms of Use

Bloggers

Learn more

Article Links

Contact

Advertise

Ask us anything

©2020- TradePoint.io - All rights reserved!

Tradepoint.io, being just a publishing and technology platform, is not a registered broker-dealer or investment adviser. So we do not provide investment advice. Rather, brokerage services are provided to clients of Tradepoint.io by independent SEC-registered broker-dealers and members of FINRA/SIPC. Every form of investing carries some risk and past performance is not a guarantee of future results. “Tradepoint.io“, “Instant Investing” and “My Trading Tools” are registered trademarks of Apperbuild, LLC.

This website is operated by Apperbuild, LLC. We have no link to any brokerage firm and we do not provide investment advice. Every information and resource we provide is solely for the education of our readers. © 2020 Apperbuild, LLC. All rights reserved.

No Result
View All Result
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop

© 2023 - TradePoint.io - All Rights Reserved!