-
Notifications
You must be signed in to change notification settings - Fork 182
Description
codec_sv2 provides a high-level API for interacting with the lower-level transport layers (framing_sv2 and binary_sv2). It exposes foundational encoders and decoders that operate directly on client byte streams and translate raw bytes into structured Sv2 frames and messages.
Each decoder/encoder maintains its own memory buffer either backed by buffer_sv2’s buffer pool or by a standard Vec to accumulate and process incoming data. This makes codec one of the most critical areas to benchmark, as it is a primary source of memory allocation and buffer growth.
Since binary_sv2 is designed around a zero-copy model by default, decoding performance is highly sensitive to buffer sizing and reuse. As reserved buffer capacity grows to accommodate larger frames, increased memory pressure can translate into higher codec latency. Benchmarking this path is therefore essential to understanding the trade-offs between buffer pooling, allocation strategy, and end-to-end decode performance.