The Question
How fast is iceoryx2 in C#? I built a benchmark to find out.
The comparison includes three technologies:
- System.Threading.Channels: .NET’s built-in producer/consumer queue
- Named Pipes: Traditional kernel-mediated IPC
- iceoryx2: Zero-copy shared memory IPC
What Each Technology Does
Channels pass object references inside a single process. Fast, but not IPC. You cannot use them between processes.
Named Pipes do real IPC. Data goes from your process into kernel space, then from kernel space into the other process. Two copies. Two context switches. Per message.
iceoryx2 maps shared memory into both processes. The publisher writes data once. The subscriber reads it directly. No copies. No kernel involvement.
Results
Throughput
| Payload | Channels | Named Pipes | iceoryx2 |
|---|---|---|---|
| 8 B | 15.3M msg/s | 648K msg/s | 2.2M msg/s |
| 1 KB | 13.6M msg/s | 316K msg/s | 2.3M msg/s |
| 64 KB | 15.7M msg/s | 4.5K msg/s | 2.1M msg/s |
| 512 KB | 15.3M msg/s | 589 msg/s | 2.0M msg/s |
Channels look fast because they only pass references. Ignore that column for IPC comparisons.
The interesting comparison is Pipes vs iceoryx2:
- Small messages (8 B): iceoryx2 is 3.3x faster
- Large messages (512 KB): iceoryx2 is 3,371x faster
Named Pipes throughput collapses with size. Every byte goes through the kernel twice. iceoryx2 stays flat. That’s zero-copy.
CPU Usage
| Payload | Channels | Named Pipes | iceoryx2 |
|---|---|---|---|
| 8 B | 180% | 1,257% | 195% |
| 512 KB | 181% | 1,183% | 195% |
Named Pipes saturates 12 cores to achieve a fraction of iceoryx2’s throughput. iceoryx2 uses 6x less CPU for the same work.
Why This Happens
Named Pipes architecture:
Process A → [copy] → Kernel Buffer → [copy] → Process B
syscall syscall
iceoryx2 architecture:
Process A → [write pointer] → Shared Memory ← [read pointer] ← Process B
No copies. No syscalls on the data path. The kernel is only involved during setup.
When to Use What
Channels: In-process producer/consumer. Simple, fast, no IPC.
Named Pipes: Cross-machine communication. Works over network. Simple setup.
iceoryx2: Same-machine IPC where performance matters. Robotics, trading, video processing, real-time systems.
Work in Progress
This benchmarking and performance optimization effort is ongoing. The numbers here reflect my current state.
Current scope: 1 publisher, 1 subscriber. The simplest case. Benchmarks for N publishers to M subscribers will follow.
If you spot issues with the methodology, have ideas for improvements, or want to contribute - I’d appreciate it. Open an issue or send a PR.
The Code
Benchmark methodology: 10-second runs, 2-second warmup, multiple payload sizes.
The benchmark code is open source: https://github.com/patdhlk/iceoryx2-csharp-int/tree/performance-comparison

