aboutsummaryrefslogtreecommitdiffstats
path: root/link/link-protocol.h
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-29 08:30:30 +0100
committereunhhu <[email protected]>2026-09-29 08:30:30 +0100
commit5545fb068a0aaf05947889185f9c390db43289fa (patch)
treeccad5380d48dc484edb6eff058b4be4f7a965b85 /link/link-protocol.h
parentd3328ebe3bb7133ad615f78d9800fe7e0d830bf2 (diff)
downloadpure-5545fb068a0aaf05947889185f9c390db43289fa.tar.gz
pure-5545fb068a0aaf05947889185f9c390db43289fa.zip
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.
Diffstat (limited to 'link/link-protocol.h')
-rw-r--r--link/link-protocol.h5
1 files changed, 3 insertions, 2 deletions
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