iceoryx2 C# vs .NET IPC: The Numbers
iceoryx2 - Zero-Copy IPC

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

PayloadChannelsNamed Pipesiceoryx2
8 B15.3M msg/s648K msg/s2.2M msg/s
1 KB13.6M msg/s316K msg/s2.3M msg/s
64 KB15.7M msg/s4.5K msg/s2.1M msg/s
512 KB15.3M msg/s589 msg/s2.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

PayloadChannelsNamed Pipesiceoryx2
8 B180%1,257%195%
512 KB181%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