v0.1.0
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-copynp.ndarrayview — ~3.5μs regardless of data sizeget_mut()returns a writable zero-copy view for in-place mutationput_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.whlRequires Python ≥ 3.12 and NumPy ≥ 2.0.