https://gitlab.synchro.net/main/sbbs/-/commit/89c0041f8bdbc119a0bf167b
Modified Files:
xtrn/mrc/mrc-client.js mrc-connector.js
Log Message:
MRC: stop busy-polling in the connector and client
The connector's main loop called yield() every pass, which is just a 1ms
sleep: as a static service it woke ~1000 times a second around the clock (measured on Vertrauen: 938 wakeups/s, ~3% of a core, with nobody in
chat), and spun at the same rate through the reconnect delay whenever the
MRC server link was down. It now blocks in socket_select() on the listen, MRC-server and client sockets (1s timeout, so the periodic STATS request
still fires), checking data_waiting first so TLS plaintext already
buffered by cryptlib isn't missed. Failed reconnects sleep 1s, and the
wait for the server's HELLO line is a poll() instead of a spin. Tested
against a fake MRC server: 917 -> 1 wakeups/s, messages still relayed
both ways within ~1ms.
The client ran ~90 passes a second per user (InputLine's 10ms key wait
plus a 1ms yield), and on every pass stat()ed the user's notification
file (an SMB round trip when the data dir is shared) and re-rendered the input-length counter. Now the key wait is 100ms (keystrokes still return
at once), the notification file is checked once a second, and the
counter is redrawn only when the input or the divider changes.
Co-Authored-By: Claude Opus 5.5 <
noreply@anthropic.com>
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net