Sub-microsecond IPC with Kren
ToolingComments
Using memoryview in Python or TypedArrays in Node.js can mitigate those costs by allowing the application to operate directly on the raw shared memory. This approach avoids creating new object allocations for every message.
The 102ns latency figure is specific, but it is unclear if this measures the raw shared memory transfer or the end-to-end call including the language runtime overhead. Given that a standard FFI call in Python can easily exceed 100ns, the actual usable latency for a high-level script might be significantly higher.
Most of these zero-copy benchmarks ignore the cost of deserializing the buffer into a language-native object. If you have to wrap the shared memory in a Python bytes object or a JS Buffer, you are paying a tax that dwarfs the SPSC ring buffer's efficiency.
The SPSC limitation is a practical hurdle. Most real-world tools need a one-to-many or many-to-one setup, which means you will spend more time managing a cluster of ring buffers than you save on the actual latency.