← Sun, Nov 8 digest

Mizu – zero-copy parallel R and Python over shared memory

read article ↗ hn thread ↗

Mizu is a C-backed IPC library enabling sub-microsecond task round trips and zero-copy data sharing between Python and R using shared memory.

read it The detailed benchmarks, architecture description, and code examples make this an exceptionally strong read for performance-minded developers.

summary

Mizu and its Python binding pymizu provide a lock-free, shared-memory inter-process communication system designed for fast parallel task execution across Python and R. Built on a low-level C core, it bypasses sockets and minimizes kernel involvement to achieve task round-trip times under one microsecond. The library supports drop-in concurrent executors, asynchronous event loops, and zero-copy transfer of NumPy arrays and Arrow-compatible frameworks like Polars and Pandas. This architecture allows fine-grained parallelism and seamless cross-language workflows on a single machine without copying payloads.

key points

  1. Achieves sub-microsecond task round trips (approx. 0.7 microseconds), outperforming standard process pools by over 100 times.
  2. Supports zero-copy data exchange for NumPy and Arrow-compatible structures including Polars, Pandas, and DuckDB.
  3. Provides drop-in compatibility with standard concurrent.futures executors and full asyncio integration.

who should read it

Python and R developers working on high-performance local data processing, parallel compute workloads, or cross-language data science pipelines.

discussion warm

consensus

Readers express strong enthusiasm for the performance claims, rigorous benchmarking, and the ability to cleanly share Arrow data structures between R and Python without performance-killing copies.

best comment by stdbrouw ↗

Amazing. I remember being really disappointed in mirai last year when learning that it couldn’t provide shared access to an in-memory arrow table. Multicore processing in R is great when it works but too often it’s just a matter of time before unwanted and unnecessary data copies completely destroy performance.

Points out how this solves specific limitations in existing R tools like mirai regarding in-memory arrow table sharing.

Generated by an LLM from the article and thread. Check the sources before relying on it.