mirror of
https://github.com/Effect-TS/effect.git
synced 2026-12-04 03:35:36 +08:00
Each sized level whose length prefix outgrew one byte moved the whole frame, so a blob nested in an RPC envelope was copied once per level. Uint8Array payloads of 16 KiB or more are now referenced instead of copied into the arena: length prefixes count them, widening a prefix moves only arena bytes, and the frame is assembled into one exact buffer, so a payload is copied once at any depth. A 256 KiB payload two levels deep encodes about 2x faster. Such frames are returned as their own buffer rather than an arena view, and a payload is read when the frame is assembled; the docs now say results may be views and that large payloads must not change while the encode runs. The wire format is unchanged.