> ## Documentation Index
> Fetch the complete documentation index at: https://whatsapp-rust.jlucaso.com/llms.txt
> Use this file to discover all available pages before exploring further.

# June 9, 2026 — Zero-copy inbound frame feeding

> FrameDecoder gains feed_bytes, eliminating the last full memcpy on the receive path in steady state.

## Performance

**Zero-copy inbound frame feeding ([#803](https://github.com/oxidezap/whatsapp-rust/pull/803))**

`FrameDecoder` in `wacore-noise` gains a new `feed_bytes(Bytes)` method that adopts an owned payload's allocation wholesale instead of copying it into the internal staging buffer.

In steady state — the WebSocket transport is message-oriented, so each message arrives on a clean frame boundary and the payload has no other references — `Bytes::try_into_mut` succeeds and the bytes are adopted without copying. The one remaining full `memcpy` of every inbound byte on the receive path is eliminated.

Shared payloads (refcount > 1) and partial-frame leftovers fall back to the existing `extend_from_slice` path, so correctness never depends on the fast path firing.

As a secondary benefit, each adopted payload is its own allocation. A node retained by the app (queued chat lane, `Event::RawNode`) now pins only its own WebSocket message's bytes instead of holding a reference into a shared staging buffer alongside unrelated data.

The main `read_messages_loop` has been updated to move the payload into `feed_bytes` instead of borrowing it for the old `feed`. The borrowing `feed` method is unchanged and remains available for the handshake path.

**No breaking changes.** `feed` is unchanged; `feed_bytes` is additive.
