https://gitlab.synchro.net/main/sbbs/-/commit/1672d1f70b2d5f2f14c794c4
Modified Files:
src/sbbs3/sexyz.c
Log Message:
sexyz: batch ZMODEM output into the ring buffer to fix send throughput
The transmit path fed the output ring buffer one byte at a time via send_byte(), so the protocol thread and the draining output_thread
ping-ponged over tiny amounts: a 32 MB send made ~2.3 million futex calls
and ~409 K writes averaging ~84 bytes. lrzsz and SyncTERM, which buffer
their output, ran several times faster over the same protocol.
Accumulate escaped output in a per-session buffer and push it into the
ring one subpacket-sized span at a time (on the zmodem flush callback, or
when the buffer fills). The output_thread and its asynchronous socket
draining are kept intact: that asynchrony is what lets the protocol thread service ZRPOS on the back-channel during error recovery, so removing the
thread (measured) stalled lossy transfers.
Results, sending to lrz over a localhost socket:
- 32 MB send: ~2.3 M -> ~12 K futex calls, ~409 K -> ~4 K writes (~8 KB ea)
- 256 MB steady-state send: ~11 -> ~66 MB/s
- error-recovery time under injected bit errors: unchanged (~50 s)
- receiver throughput: unchanged (~130 MB/s)
The remaining gap to lrzsz (~204 MB/s) is zmodem.c's per-byte send_byte-callback overhead, addressed separately.
Co-Authored-By: Claude Opus 4.8 (1M context) <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net