Repository navigation
New MPSC API
rapidfire::mpsc::{bounded, unbounded}: cloneable senders and one receiver whose receive methods require&mut self.recv_many(&mut buffer, limit): reuse a buffer and receive ready messages in batches, waiting only for the first message.- The general MPMC API remains available.
Fixes
- Prevent completing send/receive futures from absorbing a later notification and stranding another waiter.
- Keep a bounded channel's approximate
len()within its capacity during concurrent receives and refills.
Measurements and verification
The complete benchmark matrix ran on all twelve original machines. Each passed 74 native tests, four doctests and 74 release tests with three-slot blocks. The updated CI also checks Loom, Miri, Linux x86-64/ARM64 and macOS.
MPSC performance depends on workload. With 40 producers, bounded(4096), 1 KiB messages and receive limit 32, the measured throughput improvement is 4.36× on Ryzen 7950X and 1.13× on M3 Pro. An unbounded four-producer case is 5.25× slower on Ryzen 9950X. These are throughput costs, not individual handoff latency; separate paced latency measurements are included.
See the full report, all samples, README and changelog.
rapidfire = "0.2"