| Crates.io | ipc_ring |
| lib.rs | ipc_ring |
| version | 0.2.1 |
| created_at | 2025-09-03 14:19:40.279086+00 |
| updated_at | 2025-11-24 09:08:44.509794+00 |
| description | High-performance memory-mapped SPSC ring buffer for Unix IPC |
| homepage | https://github.com/Coffeeri/ipc_ring |
| repository | https://github.com/Coffeeri/ipc_ring |
| max_upload_size | |
| id | 1822605 |
| size | 100,375 |
Memory-mapped SPSC ring buffer for high-performance inter-process communication on Unix systems.
MacBook Pro 2021 M1 Pro, 32GB RAM, 1TB NVMe: 16.3M msgs/s, 3.9 GiB/s (256B messages)
{"messages":1000000,"msg_size":256,"elapsed_sec":0.061254,"msgs_per_sec":16325531,"MiB_per_sec":3985.73}
Tested against ipmpsc (serialized MPSC ring buffer) using 1M messages, 256-byte payloads, 64MB ring capacity on /tmp filesystem:
| Library | Messages/sec | Throughput | Ratio |
|---|---|---|---|
| ipc_ring | 16.3M | 3.9 GiB/s | 20.6x |
| ipmpsc | 791K | 193 MiB/s | 1x |
Use ipc_ring when:
Comparison limitations:
Perfect for: Streaming JSON events to compression/storage processes, high-frequency logging, real-time data pipelines where serialization overhead is unwanted.
cargo build --release
Writer creates ring:
let mut writer = RingWriter::create("/tmp/ring", 64 * 1024 * 1024)?;
writer.push(b"data", None)?; // None = block until space
Reader opens existing ring:
let mut reader = RingReader::open("/tmp/ring")?;
let mut buf = Vec::new();
let n = reader.pop(&mut buf, None)?; // None = block until data
cargo run --release --bin ipc_bench -- --ring /dev/shm/bench --cap 67108864