]> git.ipfire.org Git - thirdparty/public-inbox.git/commit
send_cmd: throttle `sleeping on sendmsg' messages
authorEric Wong <e@80x24.org>
Fri, 29 Nov 2024 23:54:00 +0000 (23:54 +0000)
committerEric Wong <e@80x24.org>
Sat, 30 Nov 2024 22:43:35 +0000 (22:43 +0000)
commit19b80910041f1d0fcf437f035f5cb6aedfef78ab
treea84a97a97718f46b167380d5d290d1a0348a49c1
parent237eb43a50ef7a9bd117635077421d7463158cbe
send_cmd: throttle `sleeping on sendmsg' messages

Emitting a message every 100ms was too much for busy machines.
Throttle it to 1.6s to avoid flooding user terminals by emitting
every 16 sleeps.  A power-of-two (16) was chosen for its
optimization potential via bitwise AND.  Since perl(1) doesn't
do this optimization, we open code the bitwise AND.  I don't
assume an optimizing compiler for Inline::C, either, since I
find working in C far more enjoyable with optimizations off.
lib/PublicInbox/CmdIPC4.pm
lib/PublicInbox/Spawn.pm