From 5545fb068a0aaf05947889185f9c390db43289fa Mon Sep 17 00:00:00 2001 From: eunhhu Date: Tue, 29 Sep 2026 08:30:30 +0100 Subject: Send a record in parts cut where a packet is full, not 1000-byte pieces A record that does not fit what is left of a packet goes in part when at least 64 bytes fit; its parts keep their cuts, so what a packet carried is whole parts. The receiver keeps the spans it had of a record, and a record coming in order from its start fills the line's tail with no allocation. Packets fall by 8% for 1 KiB records and 10% for 16 KiB; the CPU a record is the same at 61 B and 1 KiB and 5% less at 16 KiB. --- link/link-protocol.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'link/link-protocol.h') diff --git a/link/link-protocol.h b/link/link-protocol.h index 3f71809..e82e599 100644 --- a/link/link-protocol.h +++ b/link/link-protocol.h @@ -32,8 +32,9 @@ * shape of the messages (the sender's output and the * receiver's input must have the same): the stream the * records after it are of - * 0x02 RECORD u64 number, u32 size, u32 offset, u16 length, bytes: a piece - * of a saved send (pieces are 1000 bytes, the last shorter) + * 0x02 RECORD u64 number, u32 size, u32 offset, u16 length, bytes: part + * of a saved send (a send too large for what is left of a + * packet goes in parts, cut where the packet is full) * 0x03 ACK u64 largest number, u32 delay (µs), u8 ranges, each as u64 * first and u64 last, newest first * 0x04 STORED source, input (as STREAM), u64 the last number heard -- cgit v1.2.3