Skip to content

v0.1.0

Choose a tag to compare

@zeeshanhaque21 zeeshanhaque21 released this 02 Mar 23:15
· 2 commits to main since this release

shmem v0.1.0

Zero-copy shared memory key-value store for sharing numpy arrays and raw bytes between Python processes.

Highlights

  • put() copies data into shared memory (one memcpy)
  • get() returns a read-only zero-copy np.ndarray view — ~3.5μs regardless of data size
  • get_mut() returns a writable zero-copy view for in-place mutation
  • put_bytes() / get_bytes() for raw bytes with zero-copy memoryview
  • Readers-writers locking for safe multi-process access
  • Free-list allocator with forward/backward coalescing

Performance (1080p, 6.2 MB)

Operation Latency
put() ~300 μs
get() (zero-copy) ~3.5 μs
Cross-process throughput ~10 GB/s

Install

uv add shmem@https://github.com/zeeshanhaque21/shmem/releases/download/v0.1.0/shmem-0.1.0-py3-none-any.whl

Requires Python ≥ 3.12 and NumPy ≥ 2.0.