DataPath

Local IPC for C++11 and newer, C, Rust, Python and Node.js

Message passing with a predictable worst case.

DataPath moves whole messages between processes on the same machine, from a few bytes to many megabytes. It is built for the one round trip in a thousand that other libraries leave to chance: measured at p99.9, at the worst CPU placement, with every core busy.

$ pip install com.xaymar.datapath   # or npm, cargo, CMake
64 B round trip, idle
1.4 µs

p99.9 over shared memory, client and server on different CCDs

Every core busy
10 µs

p99.9 at 64 B, where socket-based stacks wait milliseconds for a timeslice

vs. Chromium Mojo under load
780× lower

p99.9 at 64 B on the same Linux machine

Tail latency, not averages

Round-trip p99.9 from 16 B to 1 MiB, idle and under full CPU load. Lower is better; the scale is logarithmic. Hover a mark for its value.

Linux (merenka-gpu0): round-trip latency, p99.9 (µs, log scale, lower is better)DataPath (shared memory)libuv as shippedlibuv + DataPath's spin/priorityChromium Mojo (bindings)cpp-ipc as shippedBoost.Interprocess as shippedidle, --pin 1,516 Bidle, --pin 1,5, 16 B, Chromium Mojo (bindings): 60.5 µs (runs 60.5 to 60.5)idle, --pin 1,5, 16 B, Boost.Interprocess as shipped: 31.84 µs (runs 31.08 to 40.86)idle, --pin 1,5, 16 B, cpp-ipc as shipped: 4.74 µs (runs 4.71 to 4.84)idle, --pin 1,5, 16 B, libuv as shipped: 23.07 µs (runs 22.13 to 23.85)idle, --pin 1,5, 16 B, libuv + DataPath's spin/priority: 13.68 µs (runs 13.55 to 13.84)idle, --pin 1,5, 16 B, DataPath (shared memory): 1.18 µs (runs 1.15 to 1.22)64 Bidle, --pin 1,5, 64 B, Chromium Mojo (bindings): 61.7 µs (runs 61.7 to 61.7)idle, --pin 1,5, 64 B, Boost.Interprocess as shipped: 32.2 µs (runs 31.3 to 34.36)idle, --pin 1,5, 64 B, cpp-ipc as shipped: 4.74 µs (runs 4.71 to 4.87)idle, --pin 1,5, 64 B, libuv as shipped: 22.72 µs (runs 22.48 to 23.49)idle, --pin 1,5, 64 B, libuv + DataPath's spin/priority: 13.66 µs (runs 13.44 to 13.74)idle, --pin 1,5, 64 B, DataPath (shared memory): 1.43 µs (runs 1.42 to 1.44)256 Bidle, --pin 1,5, 256 B, Chromium Mojo (bindings): 62.5 µs (runs 62.5 to 62.5)idle, --pin 1,5, 256 B, Boost.Interprocess as shipped: 31.37 µs (runs 31.17 to 34.94)idle, --pin 1,5, 256 B, cpp-ipc as shipped: 6.98 µs (runs 6.88 to 7.12)idle, --pin 1,5, 256 B, libuv as shipped: 23.99 µs (runs 22.78 to 24.4)idle, --pin 1,5, 256 B, libuv + DataPath's spin/priority: 14.27 µs (runs 13.89 to 14.41)idle, --pin 1,5, 256 B, DataPath (shared memory): 1.43 µs (runs 1.4 to 1.6)1 KiBidle, --pin 1,5, 1 KiB, Chromium Mojo (bindings): 63.1 µs (runs 63.1 to 63.1)idle, --pin 1,5, 1 KiB, Boost.Interprocess as shipped: 31.75 µs (runs 31.48 to 32.39)idle, --pin 1,5, 1 KiB, cpp-ipc as shipped: 7.16 µs (runs 6.93 to 7.21)idle, --pin 1,5, 1 KiB, libuv as shipped: 24.4 µs (runs 23.92 to 25.37)idle, --pin 1,5, 1 KiB, libuv + DataPath's spin/priority: 15.24 µs (runs 14.99 to 15.65)idle, --pin 1,5, 1 KiB, DataPath (shared memory): 1.83 µs (runs 1.77 to 1.86)4 KiBidle, --pin 1,5, 4 KiB, Chromium Mojo (bindings): 72.8 µs (runs 72.8 to 72.8)idle, --pin 1,5, 4 KiB, Boost.Interprocess as shipped: 40.88 µs (runs 37.58 to 55.43)idle, --pin 1,5, 4 KiB, cpp-ipc as shipped: 8.22 µs (runs 8.2 to 8.59)idle, --pin 1,5, 4 KiB, libuv as shipped: 28.29 µs (runs 27.14 to 28.63)idle, --pin 1,5, 4 KiB, libuv + DataPath's spin/priority: 19.62 µs (runs 18.8 to 21.05)idle, --pin 1,5, 4 KiB, DataPath (shared memory): 3.44 µs (runs 3.17 to 3.9)16 KiBidle, --pin 1,5, 16 KiB, Chromium Mojo (bindings): 86.6 µs (runs 86.6 to 86.6)idle, --pin 1,5, 16 KiB, Boost.Interprocess as shipped: 57.88 µs (runs 54.26 to 64.42)idle, --pin 1,5, 16 KiB, cpp-ipc as shipped: 12.48 µs (runs 12.34 to 12.81)idle, --pin 1,5, 16 KiB, libuv as shipped: 37.43 µs (runs 36.54 to 39.03)idle, --pin 1,5, 16 KiB, libuv + DataPath's spin/priority: 26.25 µs (runs 25.66 to 28.17)idle, --pin 1,5, 16 KiB, DataPath (shared memory): 8.93 µs (runs 8.5 to 9.09)64 KiBidle, --pin 1,5, 64 KiB, Chromium Mojo (bindings): 439 µs (runs 439 to 439)idle, --pin 1,5, 64 KiB, Boost.Interprocess as shipped: 128.32 µs (runs 127.91 to 128.79)idle, --pin 1,5, 64 KiB, cpp-ipc as shipped: 28.72 µs (runs 26.87 to 31.64)idle, --pin 1,5, 64 KiB, libuv as shipped: 63.54 µs (runs 62.36 to 69.61)idle, --pin 1,5, 64 KiB, libuv + DataPath's spin/priority: 56.31 µs (runs 56.11 to 57.61)idle, --pin 1,5, 64 KiB, DataPath (shared memory): 21.98 µs (runs 20.07 to 22.35)256 KiBidle, --pin 1,5, 256 KiB, Chromium Mojo (bindings): 2003 µs (runs 2003 to 2003)idle, --pin 1,5, 256 KiB, Boost.Interprocess as shipped: 402.58 µs (runs 396.11 to 415.48)idle, --pin 1,5, 256 KiB, cpp-ipc as shipped: 168.59 µs (runs 92.76 to 172.54)idle, --pin 1,5, 256 KiB, libuv as shipped: 147.06 µs (runs 141.18 to 153.37)idle, --pin 1,5, 256 KiB, libuv + DataPath's spin/priority: 136.24 µs (runs 134.37 to 143.68)idle, --pin 1,5, 256 KiB, DataPath (shared memory): 76.59 µs (runs 68.82 to 94.76)1 MiBidle, --pin 1,5, 1 MiB, Chromium Mojo (bindings): 8704 µs (runs 8704 to 8704)idle, --pin 1,5, 1 MiB, Boost.Interprocess as shipped: 1154.52 µs (runs 1138.85 to 1277.86)idle, --pin 1,5, 1 MiB, cpp-ipc as shipped: 340.55 µs (runs 335.66 to 354.74)idle, --pin 1,5, 1 MiB, libuv as shipped: 557.48 µs (runs 544.59 to 600.7)idle, --pin 1,5, 1 MiB, libuv + DataPath's spin/priority: 541.41 µs (runs 518.54 to 577.22)idle, --pin 1,5, 1 MiB, DataPath (shared memory): 321.33 µs (runs 308.69 to 328.37)1251020501002005001k2k5k10k20k50k100k--stress 0 --stress-nice 12 --pin 1,516 B--stress 0 --stress-nice 12 --pin 1,5, 16 B, Chromium Mojo (bindings): 7579 µs (runs 7579 to 7579)--stress 0 --stress-nice 12 --pin 1,5, 16 B, Boost.Interprocess as shipped: 385.22 µs (runs 335.07 to 1676.73)--stress 0 --stress-nice 12 --pin 1,5, 16 B, cpp-ipc as shipped: 7920.64 µs (runs 4040.38 to 7979.94)--stress 0 --stress-nice 12 --pin 1,5, 16 B, libuv as shipped: 4073.64 µs (runs 4068.21 to 4086.51)--stress 0 --stress-nice 12 --pin 1,5, 16 B, libuv + DataPath's spin/priority: 3381.64 µs (runs 354.75 to 4086.44)--stress 0 --stress-nice 12 --pin 1,5, 16 B, DataPath (shared memory): 10.25 µs (runs 7.09 to 10.98)64 B--stress 0 --stress-nice 12 --pin 1,5, 64 B, Chromium Mojo (bindings): 7852 µs (runs 7852 to 7852)--stress 0 --stress-nice 12 --pin 1,5, 64 B, Boost.Interprocess as shipped: 464.04 µs (runs 256.82 to 753.6)--stress 0 --stress-nice 12 --pin 1,5, 64 B, cpp-ipc as shipped: 5758.12 µs (runs 4074.47 to 7957.7)--stress 0 --stress-nice 12 --pin 1,5, 64 B, libuv as shipped: 4069.78 µs (runs 4066.91 to 4073.94)--stress 0 --stress-nice 12 --pin 1,5, 64 B, libuv + DataPath's spin/priority: 3494.26 µs (runs 2956.09 to 3888.66)--stress 0 --stress-nice 12 --pin 1,5, 64 B, DataPath (shared memory): 10.11 µs (runs 9.19 to 13.91)256 B--stress 0 --stress-nice 12 --pin 1,5, 256 B, Chromium Mojo (bindings): 7867 µs (runs 7867 to 7867)--stress 0 --stress-nice 12 --pin 1,5, 256 B, Boost.Interprocess as shipped: 369.4 µs (runs 347.79 to 527.79)--stress 0 --stress-nice 12 --pin 1,5, 256 B, cpp-ipc as shipped: 7995.38 µs (runs 7960.06 to 8014.29)--stress 0 --stress-nice 12 --pin 1,5, 256 B, libuv as shipped: 4070.3 µs (runs 4061.47 to 4074.32)--stress 0 --stress-nice 12 --pin 1,5, 256 B, libuv + DataPath's spin/priority: 3553.31 µs (runs 626.38 to 3669.02)--stress 0 --stress-nice 12 --pin 1,5, 256 B, DataPath (shared memory): 10.8 µs (runs 9.4 to 11.38)1 KiB--stress 0 --stress-nice 12 --pin 1,5, 1 KiB, Chromium Mojo (bindings): 7853 µs (runs 7853 to 7853)--stress 0 --stress-nice 12 --pin 1,5, 1 KiB, Boost.Interprocess as shipped: 370.3 µs (runs 324.94 to 728.18)--stress 0 --stress-nice 12 --pin 1,5, 1 KiB, cpp-ipc as shipped: 7999.01 µs (runs 7966.73 to 8016.63)--stress 0 --stress-nice 12 --pin 1,5, 1 KiB, libuv as shipped: 4065.31 µs (runs 4062.51 to 4078.71)--stress 0 --stress-nice 12 --pin 1,5, 1 KiB, libuv + DataPath's spin/priority: 3884.92 µs (runs 3266.77 to 3992.47)--stress 0 --stress-nice 12 --pin 1,5, 1 KiB, DataPath (shared memory): 13.15 µs (runs 11.88 to 14.37)4 KiB--stress 0 --stress-nice 12 --pin 1,5, 4 KiB, Chromium Mojo (bindings): 7997 µs (runs 7997 to 7997)--stress 0 --stress-nice 12 --pin 1,5, 4 KiB, Boost.Interprocess as shipped: 312.51 µs (runs 231.45 to 854.45)--stress 0 --stress-nice 12 --pin 1,5, 4 KiB, cpp-ipc as shipped: 8014.86 µs (runs 7995.62 to 8023.89)--stress 0 --stress-nice 12 --pin 1,5, 4 KiB, libuv as shipped: 4075.53 µs (runs 4070.61 to 4078.28)--stress 0 --stress-nice 12 --pin 1,5, 4 KiB, libuv + DataPath's spin/priority: 4924.09 µs (runs 4569.23 to 5628.01)--stress 0 --stress-nice 12 --pin 1,5, 4 KiB, DataPath (shared memory): 22.78 µs (runs 20.36 to 44.74)16 KiB--stress 0 --stress-nice 12 --pin 1,5, 16 KiB, Chromium Mojo (bindings): 8127 µs (runs 8127 to 8127)--stress 0 --stress-nice 12 --pin 1,5, 16 KiB, Boost.Interprocess as shipped: 3007.89 µs (runs 825.91 to 4052.85)--stress 0 --stress-nice 12 --pin 1,5, 16 KiB, libuv as shipped: 4094.22 µs (runs 4089.45 to 4096.41)--stress 0 --stress-nice 12 --pin 1,5, 16 KiB, libuv + DataPath's spin/priority: 4754.79 µs (runs 4711.27 to 5171)--stress 0 --stress-nice 12 --pin 1,5, 16 KiB, DataPath (shared memory): 50.76 µs (runs 36.63 to 284.11)64 KiB--stress 0 --stress-nice 12 --pin 1,5, 64 KiB, Chromium Mojo (bindings): 10082 µs (runs 10082 to 10082)--stress 0 --stress-nice 12 --pin 1,5, 64 KiB, Boost.Interprocess as shipped: 4687.67 µs (runs 4523.17 to 5289.63)--stress 0 --stress-nice 12 --pin 1,5, 64 KiB, libuv as shipped: 4181.48 µs (runs 4173.06 to 4191.83)--stress 0 --stress-nice 12 --pin 1,5, 64 KiB, libuv + DataPath's spin/priority: 4642.57 µs (runs 4381.94 to 4996.95)--stress 0 --stress-nice 12 --pin 1,5, 64 KiB, DataPath (shared memory): 4058.28 µs (runs 470.38 to 4137.08)256 KiB--stress 0 --stress-nice 12 --pin 1,5, 256 KiB, Chromium Mojo (bindings): 19179 µs (runs 19179 to 19179)--stress 0 --stress-nice 12 --pin 1,5, 256 KiB, Boost.Interprocess as shipped: 10829.1 µs (runs 9928.26 to 11775.4)--stress 0 --stress-nice 12 --pin 1,5, 256 KiB, libuv as shipped: 7415.5 µs (runs 7159.14 to 7582.82)--stress 0 --stress-nice 12 --pin 1,5, 256 KiB, libuv + DataPath's spin/priority: 7557.98 µs (runs 7285.19 to 7786.79)--stress 0 --stress-nice 12 --pin 1,5, 256 KiB, DataPath (shared memory): 4207.28 µs (runs 4176.52 to 5324.98)1 MiB--stress 0 --stress-nice 12 --pin 1,5, 1 MiB, Chromium Mojo (bindings): 53033 µs (runs 53033 to 53033)--stress 0 --stress-nice 12 --pin 1,5, 1 MiB, Boost.Interprocess as shipped: 18061 µs (runs 6689.31 to 18921.6)--stress 0 --stress-nice 12 --pin 1,5, 1 MiB, libuv as shipped: 12101.6 µs (runs 11730.2 to 12489.1)--stress 0 --stress-nice 12 --pin 1,5, 1 MiB, libuv + DataPath's spin/priority: 12965.8 µs (runs 12568.1 to 14202.7)--stress 0 --stress-nice 12 --pin 1,5, 1 MiB, DataPath (shared memory): 6395.99 µs (runs 4585.79 to 7306.78)1251020501002005001k2k5k10k20k50k100kPing-pong between two processes, release builds, 2026-11-23, commit cdc663a, DataPath with options::shared_memory.Mark: median p99.9 of 5 runs (DataPath under stress: median of 3 x 5 runs); whisker: lowest to highest p99.9 of any run.Chromium Mojo (a57585d): mojom bindings on the main thread, as browser code uses them; one invocation of 5 runs, so no whisker.cpp-ipc 2e28547 and Boost.Interprocess 1.92 message_queue as shipped: 2026-11-25; cpp-ipc under stress: median of 3 invocations,none of which got past 4 KiB in 30 minutes.merenka-gpu0 (client cpu1, server cpu5: different cores and CCDs): EPYC 7313P container 8C/16T, Linux 6.12, GCC 15.2.
Ping-pong between two processes, release builds, 2026-11-23, commit cdc663a, DataPath with options::shared_memory.
Mark: median p99.9 of 5 runs (DataPath under stress: median of 3 x 5 runs); whisker: lowest to highest p99.9 of any run.
Chromium Mojo (a57585d): mojom bindings on the main thread, as browser code uses them; one invocation of 5 runs, so no whisker.
cpp-ipc 2e28547 and Boost.Interprocess 1.92 message_queue as shipped: 2026-11-25; cpp-ipc under stress: median of 3 invocations, none of which got past 4 KiB in 30 minutes.
merenka-gpu0 (client cpu1, server cpu5: different cores and CCDs): EPYC 7313P container 8C/16T, Linux 6.12, GCC 15.2.
Static version of this graph
The numbers behind the graphs

Full round trip between two processes, p99.9 in µs, worst-case placement (client and server on different physical cores and, where the machine has them, different CCDs), median of 5 runs. Stress is one busy thread per logical CPU in a third process (at nice 12 on Linux); DataPath over shared memory and cpp-ipc under stress are the median of three invocations, other stress cells one. cpp-ipc and Boost.Interprocess are as shipped, measured 2026-11-25; "did not finish" means not even 16 B completed in 30 minutes.

Linux, AMD EPYC 7313P (8 cores, two CCDs), --pin 1,5:

64 B idle 4 KiB idle 64 KiB idle 1 MiB idle 64 B stress 4 KiB stress
DataPath, shared memory 1.4 3.4 22 321 10 23
cpp-ipc (shared memory) 4.7 8.2 29 341 5,758 8,015
Boost.Interprocess message_queue 32 41 128 1,155 464 313
DataPath, Unix socket 13 19 60 479 249 5,507
libuv + DataPath's spin/priority 14 20 56 541 3,494 4,924
libuv as shipped 23 28 64 557 4,070 4,076
Chromium Mojo, bindings (main thread) 62 73 439 8,704 7,852 7,997

Windows, AMD Ryzen 9 7940HS (8 cores, one CCD), --pin 8,12:

64 B idle 4 KiB idle 64 KiB idle 1 MiB idle 64 B stress 4 KiB stress
DataPath, shared memory 2.2 4.1 19 130 5.8 26
cpp-ipc (shared memory) 18 31 153 569 did not finish did not finish
Boost.Interprocess message_queue 1.1 4.1 55 6,310 did not finish did not finish
DataPath, named pipe 6.9 17 50 754 40 113
libuv + DataPath's spin/priority 15 22 74 9,659 104 187
libuv as shipped 31 35 66 1,075 265 401

Against libuv, DataPath's socket and pipe paths win through scheduling policy (busy-poll and priority), and shared memory is a further 3–10× for small messages. The two shared-memory libraries fall apart under load: cpp-ipc is about 3× DataPath idle for small messages on Linux but 4–8 ms at p99.9 with every core busy, and Boost.Interprocess is 15–20× DataPath on Linux. On Windows Boost's default spin-lock emulation is the fastest idle option for small messages, and neither library finished a 16 B run under full load in 30 minutes. Against Chromium's Mojo (Linux) it is 20–50× lower idle and 400–800× lower under full load for small messages. Full tables (p50, p99, p99.9), the methodology and the reasons are in docs/comparisons.

Small library, sharp edges filed off

No dependencies beyond the C++ standard library and the operating system. One API on every platform.

No timers on the data path

I/O threads busy-poll for 50 µs after the last event, then sleep in the kernel at raised priority. Zero-copy receive, several small messages per system call.

Shared memory by default

On Windows and Linux messages move through two rings mapped only by the two processes; the pipe or socket carries just the handshake. Handlers get a private copy a hostile peer can't change.

Whole messages

Each send() arrives as one on_message call. Messages from different threads never interleave. One server, any number of clients.

Explicit backpressure

send() never blocks and never grows without limit: it returns TooLarge or WouldBlock, and a message is queued whole or not at all.

Safe setup and teardown

User, group or world access control, a version handshake and peer validation before on_accept. Destroying a handle waits for running handlers.

Native transports

Named pipes with I/O completion ports on Windows, Unix domain sockets with epoll on Linux and kqueue on macOS. A peer without shared memory still connects.

An echo server in a dozen lines

Host a server, accept clients, reply from the handler. send() is thread-safe and safe to call from handlers.

#include <datapath/datapath.hpp>

// Server
std::shared_ptr<datapath::server> server;
datapath::host(server, "my-service");          // a named pipe or abstract socket
server->on_accept([&](std::shared_ptr<datapath::socket> client) {
    datapath::socket* raw = client.get();      // don't capture the shared_ptr in its own handler
    client->on_message([raw](const uint8_t* data, size_t size) {
        raw->send(data, size);                 // echo
    });
    clients.push_back(client);                 // keep it, or the connection closes
    return true;                               // false rejects the client
});

// Client
std::shared_ptr<datapath::socket> sock;
if (datapath::connect(sock, "my-service") == datapath::error::Success) {
    sock->on_message([](const uint8_t* data, size_t size) { /* data valid during the call */ });
    sock->send("hello", 5);
}

The same in C, Rust, Python and Node.js →

Platforms and bindings

PlatformTransportStatus
Windows 10 / 11Named pipes, IOCP; shared memorySupported
LinuxUnix domain sockets, epoll; shared memorySupported
macOSUnix domain sockets, kqueueSupported
Android, iOSas Linux / macOSPlanned

Try it on your own machine.

The benchmark harness ships with the library. Run it at your own worst-case placement and see what your current IPC does at p99.9.