# HyperQ
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/MIT)
[](https://badge.fury.io/py/hyperq)
**Hyper-fast queue for Python** - A high-performance queue implementation using Cython and C++ for inter-process communication.
## ๐ Features
- **Lightning Fast**: Optimized C++ implementation with Python bindings
- **Inter-Process Communication**: Shared memory-based queues for high-performance IPC
- **Ring Buffer Architecture**: Uses a ring buffer with double virtual memory mapping to the same physical memory.
- **Two Queue Types**:
- `HyperQ`: General-purpose queue for Python objects
- `BytesHyperQ`: Specialized queue for bytes data
- **Thread-Safe**: Safe for concurrent access
- **Unix-like Systems**: Works on Linux and macOS (POSIX-compliant systems)
- **Python 3.10+**: Modern Python support
## ๐ TODO
- [ ] **Fix multiprocessing spawn start method bug in macOS** - Critical issue with multiple consumers/producers
- Queue doesn't work properly when `multiprocessing.set_start_method('spawn')` is used
- Affects scenarios with multiple consumers and producers
- [ ] **Add `__getstate__` and `__setstate__` methods** to make queue objects picklable
- Allow passing queue objects directly to multiprocessing functions
- Serialize only the shared memory name/descriptor, not the entire queue state
- Enable seamless integration with multiprocessing.Pool and other parallel processing tools
- [ ] **Add timeout support** for `put()` and `get()` operations
- [ ] **Add non-blocking operations** (`put_nowait()`, `get_nowait()`)
- `put_nowait()`: Non-blocking put that raises `queue.Full` if queue is full
- `get_nowait()`: Non-blocking get that raises `queue.Empty` if queue is empty
- Useful for polling scenarios where you don't want to block the thread
- [ ] **Add batch operations** for better performance
- `put_many(items)`: Put multiple items in a single operation
- `get_many(count)`: Get multiple items in a single operation
- `get_all()`: Get all available items at once
- Reduces synchronization overhead for bulk operations
- [ ] **Design decision: Queue name management**
- **Option A**: Encapsulate queue names (auto-generate, hide from client)
- **Option B**: Client specifies queue names (current approach)
- **Option C**: Hybrid approach (auto-generate with optional override)
- [ ] **Add Windows support** (requires different shared memory implementation)
- [ ] **Add more comprehensive tests** including stress tests and edge cases
- [ ] **Add documentation** for advanced usage patterns
- **orjson + BytesHyperQ for JSON**: Use `orjson.dumps()` + `BytesHyperQ` for fastest JSON serialization and transfer.
## โ ๏ธ Platform Support
**Currently supported:**
- โ
Linux
- โ ๏ธ macOS (There is an issue when start method is set to spawn and there are multiple producers/consumers)
**Not supported:**
- โ Windows (uses POSIX-specific APIs)
- โ PyPy
## ๐ง Technical Details
### Ring Buffer Implementation
HyperQ uses a ring buffer with double virtual memory mapping to the same physical memory. This eliminates the need for 2 memcpy operations when data wraps around the buffer boundaries.
### Shared Memory Architecture
- **Header segment**: Contains queue metadata, synchronization primitives, and buffer information
- **Buffer segment**: The actual data storage with double virtual memory mapping
- **POSIX shared memory**: Uses `shm_open()` and `mmap()` for cross-process memory sharing
- **Synchronization**: Uses POSIX mutexes and condition variables for thread/process safety
## ๐ฆ Installation
### From PyPI
```bash
pip install hyperq
```
### From Source
```bash
git clone https://github.com/martinmkhitaryan/hyperq.git
cd hyperq
pip install -e .
```
### Development Installation
```bash
git clone https://github.com/martinmkhitaryan/hyperq.git
cd hyperq
pip install -e ".[test]"
```
## ๐ฏ Quick Start
### Basic Usage
```python
import multiprocessing as mp
from hyperq import HyperQ, BytesHyperQ
# Create a queue with 1MB capacity
queue = HyperQ(1024 * 1024, name="my_queue")
# Put data
queue.put("Hello, World!")
queue.put(42)
queue.put({"key": "value"})
# Get data
data = queue.get() # "Hello, World!"
number = queue.get() # 42
obj = queue.get() # {"key": "value"}
```
### Inter-Process Communication
```python
import multiprocessing as mp
from hyperq import HyperQ
def producer(queue_name):
queue = HyperQ(queue_name)
for i in range(1000):
queue.put(f"Message {i}")
def consumer(queue_name):
queue = HyperQ(queue_name)
for _ in range(1000):
message = queue.get()
print(f"Received: {message}")
if __name__ == "__main__":
# Create queue in main process
queue = HyperQ(1024 * 1024, name="shared_queue")
queue_name = queue.shm_name
# Start producer and consumer processes
p1 = mp.Process(target=producer, args=(queue_name,))
p2 = mp.Process(target=consumer, args=(queue_name,))
p1.start()
p2.start()
p1.join()
p2.join()
```
### Bytes-Specific Queue (Faster)
```python
from hyperq import BytesHyperQ
# For bytes data, use BytesHyperQ for better performance
queue = BytesHyperQ(1024 * 1024, name="bytes_queue")
# Put bytes data
queue.put(b"Hello, World!")
queue.put(b"Binary data")
# Get bytes data
data = queue.get() # b"Hello, World!"
```
## ๐ Performance Benchmarks
HyperQ is designed for high-performance scenarios. Here are some benchmark results:
**Hardware:**
- **CPU**: Intelยฎ Coreโข i3-12100
- **Memory**: 8GB
- **OS**: Ubuntu 22.04 / Virtual Box
- **Python**: 3.12
### Benchmark bytes transfering.
```bash
Running bytes performance benchmarks...
================================================================================
Results for 100,000 messages of 32 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.018 0.000 5,528,243
HyperQ 0.090 0.001 1,106,593
multiprocessing.Queue 0.334 0.003 299,499
faster-fifo 0.406 0.004 246,330
๐ Fastest: BytesHyperQ with 5,528,243 items/s
5.0x faster than HyperQ
18.5x faster than multiprocessing.Queue
22.4x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 64 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.020 0.000 5,067,022
HyperQ 0.090 0.001 1,105,261
multiprocessing.Queue 0.388 0.004 257,635
faster-fifo 0.397 0.004 251,805
๐ Fastest: BytesHyperQ with 5,067,022 items/s
4.6x faster than HyperQ
19.7x faster than multiprocessing.Queue
20.1x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 128 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.025 0.000 3,988,545
HyperQ 0.102 0.001 984,694
multiprocessing.Queue 0.332 0.003 301,471
faster-fifo 0.402 0.004 248,764
๐ Fastest: BytesHyperQ with 3,988,545 items/s
4.1x faster than HyperQ
13.2x faster than multiprocessing.Queue
16.0x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 256 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.030 0.000 3,280,452
HyperQ 0.098 0.001 1,024,640
multiprocessing.Queue 0.344 0.003 290,311
faster-fifo 0.395 0.004 253,071
๐ Fastest: BytesHyperQ with 3,280,452 items/s
3.2x faster than HyperQ
11.3x faster than multiprocessing.Queue
13.0x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 512 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.028 0.000 3,550,212
HyperQ 0.105 0.001 956,745
multiprocessing.Queue 0.357 0.004 279,993
faster-fifo 0.420 0.004 238,251
๐ Fastest: BytesHyperQ with 3,550,212 items/s
3.7x faster than HyperQ
12.7x faster than multiprocessing.Queue
14.9x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 1024 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.042 0.000 2,390,645
HyperQ 0.109 0.001 917,085
multiprocessing.Queue 0.379 0.004 263,922
faster-fifo 0.413 0.004 241,983
๐ Fastest: BytesHyperQ with 2,390,645 items/s
2.6x faster than HyperQ
9.1x faster than multiprocessing.Queue
9.9x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 4096 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.077 0.001 1,296,410
HyperQ 0.153 0.002 653,955
multiprocessing.Queue 0.420 0.004 238,116
faster-fifo 0.437 0.004 228,823
๐ Fastest: BytesHyperQ with 1,296,410 items/s
2.0x faster than HyperQ
5.4x faster than multiprocessing.Queue
5.7x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 8192 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.107 0.001 936,460
HyperQ 0.203 0.002 492,091
multiprocessing.Queue 0.497 0.005 201,165
faster-fifo 0.539 0.005 185,473
๐ Fastest: BytesHyperQ with 936,460 items/s
1.9x faster than HyperQ
4.7x faster than multiprocessing.Queue
5.0x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 16384 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.189 0.002 528,889
HyperQ 0.303 0.003 329,876
multiprocessing.Queue 0.658 0.007 152,017
faster-fifo 0.762 0.008 131,168
๐ Fastest: BytesHyperQ with 528,889 items/s
1.6x faster than HyperQ
3.5x faster than multiprocessing.Queue
4.0x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 32768 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.375 0.004 266,432
HyperQ 0.484 0.005 206,720
faster-fifo 0.939 0.009 106,544
multiprocessing.Queue 1.053 0.011 94,985
๐ Fastest: BytesHyperQ with 266,432 items/s
1.3x faster than HyperQ
2.5x faster than faster-fifo
2.8x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 32 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.097 0.000 4,142,198
HyperQ 0.313 0.001 1,276,678
faster-fifo 0.863 0.002 463,335
multiprocessing.Queue 2.907 0.007 137,604
๐ Fastest: BytesHyperQ with 4,142,198 items/s
3.2x faster than HyperQ
8.9x faster than faster-fifo
30.1x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 64 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.108 0.000 3,713,089
HyperQ 0.336 0.001 1,189,575
faster-fifo 0.847 0.002 472,108
multiprocessing.Queue 2.928 0.007 136,622
๐ Fastest: BytesHyperQ with 3,713,089 items/s
3.1x faster than HyperQ
7.9x faster than faster-fifo
27.2x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 128 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.104 0.000 3,838,310
HyperQ 0.293 0.001 1,365,044
faster-fifo 0.880 0.002 454,557
multiprocessing.Queue 2.968 0.007 134,779
๐ Fastest: BytesHyperQ with 3,838,310 items/s
2.8x faster than HyperQ
8.4x faster than faster-fifo
28.5x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 256 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.121 0.000 3,306,829
HyperQ 0.346 0.001 1,156,464
faster-fifo 0.848 0.002 471,452
multiprocessing.Queue 3.024 0.008 132,281
๐ Fastest: BytesHyperQ with 3,306,829 items/s
2.9x faster than HyperQ
7.0x faster than faster-fifo
25.0x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 512 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.139 0.000 2,870,961
HyperQ 0.413 0.001 968,493
faster-fifo 0.892 0.002 448,522
multiprocessing.Queue 3.143 0.008 127,257
๐ Fastest: BytesHyperQ with 2,870,961 items/s
3.0x faster than HyperQ
6.4x faster than faster-fifo
22.6x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 1024 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.209 0.001 1,918,401
HyperQ 0.546 0.001 732,611
faster-fifo 0.929 0.002 430,677
multiprocessing.Queue 3.299 0.008 121,240
๐ Fastest: BytesHyperQ with 1,918,401 items/s
2.6x faster than HyperQ
4.5x faster than faster-fifo
15.8x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 4096 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.400 0.001 1,001,018
HyperQ 0.745 0.002 536,564
faster-fifo 1.176 0.003 340,031
multiprocessing.Queue 4.032 0.010 99,196
๐ Fastest: BytesHyperQ with 1,001,018 items/s
1.9x faster than HyperQ
2.9x faster than faster-fifo
10.1x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 8192 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.679 0.002 589,081
HyperQ 1.111 0.003 359,917
faster-fifo 1.554 0.004 257,363
multiprocessing.Queue 4.742 0.012 84,353
๐ Fastest: BytesHyperQ with 589,081 items/s
1.6x faster than HyperQ
2.3x faster than faster-fifo
7.0x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 16384 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 1.278 0.003 313,053
HyperQ 1.765 0.004 226,633
faster-fifo 2.442 0.006 163,817
multiprocessing.Queue 6.288 0.016 63,613
๐ Fastest: BytesHyperQ with 313,053 items/s
1.4x faster than HyperQ
1.9x faster than faster-fifo
4.9x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 32768 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 2.374 0.006 168,526
HyperQ 2.887 0.007 138,536
faster-fifo 3.804 0.010 105,154
multiprocessing.Queue 10.354 0.026 38,634
๐ Fastest: BytesHyperQ with 168,526 items/s
1.2x faster than HyperQ
1.6x faster than faster-fifo
4.4x faster than multiprocessing.Queue
Running bytes performance benchmarks...
================================================================================
Results for 100,000 messages of 32 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.018 0.000 5,528,243
HyperQ 0.090 0.001 1,106,593
multiprocessing.Queue 0.334 0.003 299,499
faster-fifo 0.406 0.004 246,330
๐ Fastest: BytesHyperQ with 5,528,243 items/s
5.0x faster than HyperQ
18.5x faster than multiprocessing.Queue
22.4x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 64 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.020 0.000 5,067,022
HyperQ 0.090 0.001 1,105,261
multiprocessing.Queue 0.388 0.004 257,635
faster-fifo 0.397 0.004 251,805
๐ Fastest: BytesHyperQ with 5,067,022 items/s
4.6x faster than HyperQ
19.7x faster than multiprocessing.Queue
20.1x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 128 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.025 0.000 3,988,545
HyperQ 0.102 0.001 984,694
multiprocessing.Queue 0.332 0.003 301,471
faster-fifo 0.402 0.004 248,764
๐ Fastest: BytesHyperQ with 3,988,545 items/s
4.1x faster than HyperQ
13.2x faster than multiprocessing.Queue
16.0x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 256 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.030 0.000 3,280,452
HyperQ 0.098 0.001 1,024,640
multiprocessing.Queue 0.344 0.003 290,311
faster-fifo 0.395 0.004 253,071
๐ Fastest: BytesHyperQ with 3,280,452 items/s
3.2x faster than HyperQ
11.3x faster than multiprocessing.Queue
13.0x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 512 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.028 0.000 3,550,212
HyperQ 0.105 0.001 956,745
multiprocessing.Queue 0.357 0.004 279,993
faster-fifo 0.420 0.004 238,251
๐ Fastest: BytesHyperQ with 3,550,212 items/s
3.7x faster than HyperQ
12.7x faster than multiprocessing.Queue
14.9x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 1024 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.042 0.000 2,390,645
HyperQ 0.109 0.001 917,085
multiprocessing.Queue 0.379 0.004 263,922
faster-fifo 0.413 0.004 241,983
๐ Fastest: BytesHyperQ with 2,390,645 items/s
2.6x faster than HyperQ
9.1x faster than multiprocessing.Queue
9.9x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 4096 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.077 0.001 1,296,410
HyperQ 0.153 0.002 653,955
multiprocessing.Queue 0.420 0.004 238,116
faster-fifo 0.437 0.004 228,823
๐ Fastest: BytesHyperQ with 1,296,410 items/s
2.0x faster than HyperQ
5.4x faster than multiprocessing.Queue
5.7x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 8192 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.107 0.001 936,460
HyperQ 0.203 0.002 492,091
multiprocessing.Queue 0.497 0.005 201,165
faster-fifo 0.539 0.005 185,473
๐ Fastest: BytesHyperQ with 936,460 items/s
1.9x faster than HyperQ
4.7x faster than multiprocessing.Queue
5.0x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 16384 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.189 0.002 528,889
HyperQ 0.303 0.003 329,876
multiprocessing.Queue 0.658 0.007 152,017
faster-fifo 0.762 0.008 131,168
๐ Fastest: BytesHyperQ with 528,889 items/s
1.6x faster than HyperQ
3.5x faster than multiprocessing.Queue
4.0x faster than faster-fifo
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 32768 bytes per producer:
Total messages: 100,000 (1 producers, 1 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.375 0.004 266,432
HyperQ 0.484 0.005 206,720
faster-fifo 0.939 0.009 106,544
multiprocessing.Queue 1.053 0.011 94,985
๐ Fastest: BytesHyperQ with 266,432 items/s
1.3x faster than HyperQ
2.5x faster than faster-fifo
2.8x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 32 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.097 0.000 4,142,198
HyperQ 0.313 0.001 1,276,678
faster-fifo 0.863 0.002 463,335
multiprocessing.Queue 2.907 0.007 137,604
๐ Fastest: BytesHyperQ with 4,142,198 items/s
3.2x faster than HyperQ
8.9x faster than faster-fifo
30.1x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 64 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.108 0.000 3,713,089
HyperQ 0.336 0.001 1,189,575
faster-fifo 0.847 0.002 472,108
multiprocessing.Queue 2.928 0.007 136,622
๐ Fastest: BytesHyperQ with 3,713,089 items/s
3.1x faster than HyperQ
7.9x faster than faster-fifo
27.2x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 128 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.104 0.000 3,838,310
HyperQ 0.293 0.001 1,365,044
faster-fifo 0.880 0.002 454,557
multiprocessing.Queue 2.968 0.007 134,779
๐ Fastest: BytesHyperQ with 3,838,310 items/s
2.8x faster than HyperQ
8.4x faster than faster-fifo
28.5x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 256 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.121 0.000 3,306,829
HyperQ 0.346 0.001 1,156,464
faster-fifo 0.848 0.002 471,452
multiprocessing.Queue 3.024 0.008 132,281
๐ Fastest: BytesHyperQ with 3,306,829 items/s
2.9x faster than HyperQ
7.0x faster than faster-fifo
25.0x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 512 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.139 0.000 2,870,961
HyperQ 0.413 0.001 968,493
faster-fifo 0.892 0.002 448,522
multiprocessing.Queue 3.143 0.008 127,257
๐ Fastest: BytesHyperQ with 2,870,961 items/s
3.0x faster than HyperQ
6.4x faster than faster-fifo
22.6x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 1024 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.209 0.001 1,918,401
HyperQ 0.546 0.001 732,611
faster-fifo 0.929 0.002 430,677
multiprocessing.Queue 3.299 0.008 121,240
๐ Fastest: BytesHyperQ with 1,918,401 items/s
2.6x faster than HyperQ
4.5x faster than faster-fifo
15.8x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 4096 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.400 0.001 1,001,018
HyperQ 0.745 0.002 536,564
faster-fifo 1.176 0.003 340,031
multiprocessing.Queue 4.032 0.010 99,196
๐ Fastest: BytesHyperQ with 1,001,018 items/s
1.9x faster than HyperQ
2.9x faster than faster-fifo
10.1x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 8192 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 0.679 0.002 589,081
HyperQ 1.111 0.003 359,917
faster-fifo 1.554 0.004 257,363
multiprocessing.Queue 4.742 0.012 84,353
๐ Fastest: BytesHyperQ with 589,081 items/s
1.6x faster than HyperQ
2.3x faster than faster-fifo
7.0x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 16384 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 1.278 0.003 313,053
HyperQ 1.765 0.004 226,633
faster-fifo 2.442 0.006 163,817
multiprocessing.Queue 6.288 0.016 63,613
๐ Fastest: BytesHyperQ with 313,053 items/s
1.4x faster than HyperQ
1.9x faster than faster-fifo
4.9x faster than multiprocessing.Queue
================================================================================
Sleeping 2 seconds before next test configuration...
Results for 100,000 messages of 32768 bytes per producer:
Total messages: 400,000 (4 producers, 4 consumers)
--------------------------------------------------------------------------------
Queue Type Total Time (s) Latency (ms) Throughput (items/s)
--------------------------------------------------------------------------------
BytesHyperQ 2.374 0.006 168,526
HyperQ 2.887 0.007 138,536
faster-fifo 3.804 0.010 105,154
multiprocessing.Queue 10.354 0.026 38,634
๐ Fastest: BytesHyperQ with 168,526 items/s
1.2x faster than HyperQ
1.6x faster than faster-fifo
4.4x faster than multiprocessing.Queue
```
*Results may vary depending on hardware and system configuration.*
## ๐ง API Reference
### HyperQ
```python
class HyperQ:
def __init__(self, capacity: int, name: str = None)
def put(self, item) -> bool
def get(self) # Blocks until data is available
def empty(self) -> bool
def full(self) -> bool
def size(self) -> int
def clear(self)
```
### BytesHyperQ
```python
class BytesHyperQ:
def __init__(self, capacity: int, name: str = None)
def put(self, data: bytes) -> bool
def get(self) -> bytes # Blocks until data is available
def empty(self) -> bool
def full(self) -> bool
def size(self) -> int
def clear(self)
```
### Parameters
- **capacity**: Maximum size of the queue in bytes
- **name**: Optional name for the shared memory segment (max 28 characters)
### Important Notes
- **Blocking operations**: `get()` blocks indefinitely until data is available
- **No timeout support**: Currently no timeout functionality is implemented
- **Queue names**: Must be 28 characters or less
- **Platform limitation**: Only works on Unix-like systems (Linux/macOS)
## ๐งช Running Tests
```bash
# Run all tests
pytest
# Run with coverage
pytest --cov=hyperq
```
## ๐ Running Benchmarks
```bash
python benchmarks/benchmark_bytes_transfering.py
```
## ๐๏ธ Building from Source
### Prerequisites
- Python 3.10+
- Cython >= 0.29.0
- C++ compiler with C++20 support (GCC 8+, Clang 10+)
- Unix-like system (Linux or macOS)
### Build Steps
```bash
# Clone the repository
git clone https://github.com/martinmkhitaryan/hyperq.git
cd hyperq
# Install build dependencies
pip install -e ".[test]"
# Build the extension
python setup.py build_ext --inplace
```
## ๐ค Contributing
### Development Setup
1. Fork the repository
2. Create a virtual environment: `python -m venv .venv`
3. Activate it: `source .venv/bin/activate` (Linux/macOS)
4. Install development dependencies: `pip install -e ".[test]"`
5. Run tests: `pytest`
6. Make your changes and submit a pull request
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐ Acknowledgments
- Built with [Cython](https://cython.org/) for high-performance Python extensions
- Uses POSIX shared memory and threading primitives
- Inspired by the need for faster inter-process communication in Python
## ๐ Support
- **Issues**: [GitHub Issues](https://github.com/martinmkhitaryan/hyperq/issues)
- **Discussions**: [GitHub Discussions](https://github.com/martinmkhitaryan/hyperq/discussions)
- **Email**: mkhitaryan.martin@2000gmail.com
## ๐ Version History
- **1.0.0**: First working version on Linux and macOS (single producer and single consumer only; multiple producers or consumers not supported).
- **0.1.0**: Refactored constructor and destructor in hyperq.hpp; reference count via atomic variable.
- **0.0.9**: Updated benchmarks in README.md.
- **0.0.8**: Updated benchmark suite, test suite, pyproject.toml configuration; optimized CI/CD release workflow.
- **0.0.7**: Replaced is_creator logic with ref count logic for better shared memory management; identified and documented issue with multiprocessing spawn start method not working properly with multiple consumers and producers.
- **0.0.6**: Fix cibuildwheel configurations.
- **0.0.5**: Added platform-specific build and skip patterns for Linux and macOS; improved cibuildwheel configuration with separate build targets for manylinux and macosx wheels
- **0.0.4**: Fixed cibuildwheel configuration for proper multi-platform wheel builds; added architecture-specific settings for Linux (x86_64/i686) and macOS (x86_64/arm64);
- **0.0.3**: Fixed cibuildwheel configuration for proper linux wheel build;
- **0.0.2**: Added proper PyPI wheel support for Linux and macOS using cibuildwheel; improved release workflow for multi-platform builds and C++20 compatibility
- **0.0.1**: Initial release with HyperQ and BytesHyperQ implementations
---
Raw data
{
"_id": null,
"home_page": null,
"name": "hyperq",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "queue, hyper, hyper-queue, hyperqueue, high-performance, inter-process-communication, ipc, shared-memory, ring-buffer, multiprocessing, threading, cython, c++, python, fast, low-latency, concurrent, synchronization, posix, unix, linux, macos",
"author": null,
"author_email": "Martin Mkhitaryan <mkhitaryan.martin@2000gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/10/7e/fd30d628cbfa0849df4f012c7ddbbe602d4be9d2673f6addc5773c936fa5/hyperq-1.0.0.tar.gz",
"platform": null,
"description": "# HyperQ\n\n[](https://www.python.org/downloads/)\n[](https://opensource.org/licenses/MIT)\n[](https://badge.fury.io/py/hyperq)\n\n**Hyper-fast queue for Python** - A high-performance queue implementation using Cython and C++ for inter-process communication.\n\n## \ud83d\ude80 Features\n\n- **Lightning Fast**: Optimized C++ implementation with Python bindings\n- **Inter-Process Communication**: Shared memory-based queues for high-performance IPC\n- **Ring Buffer Architecture**: Uses a ring buffer with double virtual memory mapping to the same physical memory.\n- **Two Queue Types**:\n - `HyperQ`: General-purpose queue for Python objects\n - `BytesHyperQ`: Specialized queue for bytes data\n- **Thread-Safe**: Safe for concurrent access\n- **Unix-like Systems**: Works on Linux and macOS (POSIX-compliant systems)\n- **Python 3.10+**: Modern Python support\n\n## \ud83d\udccb TODO\n\n- [ ] **Fix multiprocessing spawn start method bug in macOS** - Critical issue with multiple consumers/producers\n - Queue doesn't work properly when `multiprocessing.set_start_method('spawn')` is used\n - Affects scenarios with multiple consumers and producers\n- [ ] **Add `__getstate__` and `__setstate__` methods** to make queue objects picklable\n - Allow passing queue objects directly to multiprocessing functions\n - Serialize only the shared memory name/descriptor, not the entire queue state\n - Enable seamless integration with multiprocessing.Pool and other parallel processing tools\n- [ ] **Add timeout support** for `put()` and `get()` operations\n- [ ] **Add non-blocking operations** (`put_nowait()`, `get_nowait()`)\n - `put_nowait()`: Non-blocking put that raises `queue.Full` if queue is full\n - `get_nowait()`: Non-blocking get that raises `queue.Empty` if queue is empty\n - Useful for polling scenarios where you don't want to block the thread\n- [ ] **Add batch operations** for better performance\n - `put_many(items)`: Put multiple items in a single operation\n - `get_many(count)`: Get multiple items in a single operation\n - `get_all()`: Get all available items at once\n - Reduces synchronization overhead for bulk operations\n- [ ] **Design decision: Queue name management**\n - **Option A**: Encapsulate queue names (auto-generate, hide from client)\n - **Option B**: Client specifies queue names (current approach)\n - **Option C**: Hybrid approach (auto-generate with optional override)\n- [ ] **Add Windows support** (requires different shared memory implementation)\n- [ ] **Add more comprehensive tests** including stress tests and edge cases\n- [ ] **Add documentation** for advanced usage patterns\n - **orjson + BytesHyperQ for JSON**: Use `orjson.dumps()` + `BytesHyperQ` for fastest JSON serialization and transfer.\n\n\n\n## \u26a0\ufe0f Platform Support\n\n**Currently supported:**\n- \u2705 Linux\n- \u26a0\ufe0f macOS (There is an issue when start method is set to spawn and there are multiple producers/consumers)\n\n**Not supported:**\n- \u274c Windows (uses POSIX-specific APIs)\n- \u274c PyPy\n\n## \ud83d\udd27 Technical Details\n\n### Ring Buffer Implementation\n\nHyperQ uses a ring buffer with double virtual memory mapping to the same physical memory. This eliminates the need for 2 memcpy operations when data wraps around the buffer boundaries.\n\n### Shared Memory Architecture\n\n- **Header segment**: Contains queue metadata, synchronization primitives, and buffer information\n- **Buffer segment**: The actual data storage with double virtual memory mapping\n- **POSIX shared memory**: Uses `shm_open()` and `mmap()` for cross-process memory sharing\n- **Synchronization**: Uses POSIX mutexes and condition variables for thread/process safety\n\n## \ud83d\udce6 Installation\n\n### From PyPI\n\n```bash\npip install hyperq\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/martinmkhitaryan/hyperq.git\ncd hyperq\npip install -e .\n```\n\n### Development Installation\n\n```bash\ngit clone https://github.com/martinmkhitaryan/hyperq.git\ncd hyperq\npip install -e \".[test]\"\n```\n\n## \ud83c\udfaf Quick Start\n\n### Basic Usage\n\n```python\nimport multiprocessing as mp\nfrom hyperq import HyperQ, BytesHyperQ\n\n# Create a queue with 1MB capacity\nqueue = HyperQ(1024 * 1024, name=\"my_queue\")\n\n# Put data\nqueue.put(\"Hello, World!\")\nqueue.put(42)\nqueue.put({\"key\": \"value\"})\n\n# Get data\ndata = queue.get() # \"Hello, World!\"\nnumber = queue.get() # 42\nobj = queue.get() # {\"key\": \"value\"}\n```\n\n### Inter-Process Communication\n\n```python\nimport multiprocessing as mp\nfrom hyperq import HyperQ\n\ndef producer(queue_name):\n queue = HyperQ(queue_name)\n for i in range(1000):\n queue.put(f\"Message {i}\")\n\ndef consumer(queue_name):\n queue = HyperQ(queue_name)\n for _ in range(1000):\n message = queue.get()\n print(f\"Received: {message}\")\n\nif __name__ == \"__main__\":\n # Create queue in main process\n queue = HyperQ(1024 * 1024, name=\"shared_queue\")\n queue_name = queue.shm_name\n\n # Start producer and consumer processes\n p1 = mp.Process(target=producer, args=(queue_name,))\n p2 = mp.Process(target=consumer, args=(queue_name,))\n\n p1.start()\n p2.start()\n p1.join()\n p2.join()\n```\n\n### Bytes-Specific Queue (Faster)\n\n```python\nfrom hyperq import BytesHyperQ\n\n# For bytes data, use BytesHyperQ for better performance\nqueue = BytesHyperQ(1024 * 1024, name=\"bytes_queue\")\n\n# Put bytes data\nqueue.put(b\"Hello, World!\")\nqueue.put(b\"Binary data\")\n\n# Get bytes data\ndata = queue.get() # b\"Hello, World!\"\n```\n\n## \ud83d\udcca Performance Benchmarks\n\nHyperQ is designed for high-performance scenarios. Here are some benchmark results:\n\n**Hardware:**\n- **CPU**: Intel\u00ae Core\u2122 i3-12100 \n- **Memory**: 8GB\n- **OS**: Ubuntu 22.04 / Virtual Box\n- **Python**: 3.12\n\n\n### Benchmark bytes transfering.\n```bash\nRunning bytes performance benchmarks...\n================================================================================\n\nResults for 100,000 messages of 32 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.018 0.000 5,528,243 \nHyperQ 0.090 0.001 1,106,593 \nmultiprocessing.Queue 0.334 0.003 299,499 \nfaster-fifo 0.406 0.004 246,330 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 5,528,243 items/s\n 5.0x faster than HyperQ\n 18.5x faster than multiprocessing.Queue\n 22.4x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 64 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.020 0.000 5,067,022 \nHyperQ 0.090 0.001 1,105,261 \nmultiprocessing.Queue 0.388 0.004 257,635 \nfaster-fifo 0.397 0.004 251,805 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 5,067,022 items/s\n 4.6x faster than HyperQ\n 19.7x faster than multiprocessing.Queue\n 20.1x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 128 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.025 0.000 3,988,545 \nHyperQ 0.102 0.001 984,694 \nmultiprocessing.Queue 0.332 0.003 301,471 \nfaster-fifo 0.402 0.004 248,764 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 3,988,545 items/s\n 4.1x faster than HyperQ\n 13.2x faster than multiprocessing.Queue\n 16.0x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 256 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.030 0.000 3,280,452 \nHyperQ 0.098 0.001 1,024,640 \nmultiprocessing.Queue 0.344 0.003 290,311 \nfaster-fifo 0.395 0.004 253,071 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 3,280,452 items/s\n 3.2x faster than HyperQ\n 11.3x faster than multiprocessing.Queue\n 13.0x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 512 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.028 0.000 3,550,212 \nHyperQ 0.105 0.001 956,745 \nmultiprocessing.Queue 0.357 0.004 279,993 \nfaster-fifo 0.420 0.004 238,251 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 3,550,212 items/s\n 3.7x faster than HyperQ\n 12.7x faster than multiprocessing.Queue\n 14.9x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 1024 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.042 0.000 2,390,645 \nHyperQ 0.109 0.001 917,085 \nmultiprocessing.Queue 0.379 0.004 263,922 \nfaster-fifo 0.413 0.004 241,983 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 2,390,645 items/s\n 2.6x faster than HyperQ\n 9.1x faster than multiprocessing.Queue\n 9.9x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 4096 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.077 0.001 1,296,410 \nHyperQ 0.153 0.002 653,955 \nmultiprocessing.Queue 0.420 0.004 238,116 \nfaster-fifo 0.437 0.004 228,823 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 1,296,410 items/s\n 2.0x faster than HyperQ\n 5.4x faster than multiprocessing.Queue\n 5.7x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 8192 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.107 0.001 936,460 \nHyperQ 0.203 0.002 492,091 \nmultiprocessing.Queue 0.497 0.005 201,165 \nfaster-fifo 0.539 0.005 185,473 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 936,460 items/s\n 1.9x faster than HyperQ\n 4.7x faster than multiprocessing.Queue\n 5.0x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 16384 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.189 0.002 528,889 \nHyperQ 0.303 0.003 329,876 \nmultiprocessing.Queue 0.658 0.007 152,017 \nfaster-fifo 0.762 0.008 131,168 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 528,889 items/s\n 1.6x faster than HyperQ\n 3.5x faster than multiprocessing.Queue\n 4.0x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 32768 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.375 0.004 266,432 \nHyperQ 0.484 0.005 206,720 \nfaster-fifo 0.939 0.009 106,544 \nmultiprocessing.Queue 1.053 0.011 94,985 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 266,432 items/s\n 1.3x faster than HyperQ\n 2.5x faster than faster-fifo\n 2.8x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 32 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.097 0.000 4,142,198 \nHyperQ 0.313 0.001 1,276,678 \nfaster-fifo 0.863 0.002 463,335 \nmultiprocessing.Queue 2.907 0.007 137,604 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 4,142,198 items/s\n 3.2x faster than HyperQ\n 8.9x faster than faster-fifo\n 30.1x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 64 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.108 0.000 3,713,089 \nHyperQ 0.336 0.001 1,189,575 \nfaster-fifo 0.847 0.002 472,108 \nmultiprocessing.Queue 2.928 0.007 136,622 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 3,713,089 items/s\n 3.1x faster than HyperQ\n 7.9x faster than faster-fifo\n 27.2x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 128 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.104 0.000 3,838,310 \nHyperQ 0.293 0.001 1,365,044 \nfaster-fifo 0.880 0.002 454,557 \nmultiprocessing.Queue 2.968 0.007 134,779 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 3,838,310 items/s\n 2.8x faster than HyperQ\n 8.4x faster than faster-fifo\n 28.5x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 256 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.121 0.000 3,306,829 \nHyperQ 0.346 0.001 1,156,464 \nfaster-fifo 0.848 0.002 471,452 \nmultiprocessing.Queue 3.024 0.008 132,281 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 3,306,829 items/s\n 2.9x faster than HyperQ\n 7.0x faster than faster-fifo\n 25.0x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 512 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.139 0.000 2,870,961 \nHyperQ 0.413 0.001 968,493 \nfaster-fifo 0.892 0.002 448,522 \nmultiprocessing.Queue 3.143 0.008 127,257 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 2,870,961 items/s\n 3.0x faster than HyperQ\n 6.4x faster than faster-fifo\n 22.6x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 1024 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.209 0.001 1,918,401 \nHyperQ 0.546 0.001 732,611 \nfaster-fifo 0.929 0.002 430,677 \nmultiprocessing.Queue 3.299 0.008 121,240 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 1,918,401 items/s\n 2.6x faster than HyperQ\n 4.5x faster than faster-fifo\n 15.8x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 4096 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.400 0.001 1,001,018 \nHyperQ 0.745 0.002 536,564 \nfaster-fifo 1.176 0.003 340,031 \nmultiprocessing.Queue 4.032 0.010 99,196 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 1,001,018 items/s\n 1.9x faster than HyperQ\n 2.9x faster than faster-fifo\n 10.1x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 8192 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.679 0.002 589,081 \nHyperQ 1.111 0.003 359,917 \nfaster-fifo 1.554 0.004 257,363 \nmultiprocessing.Queue 4.742 0.012 84,353 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 589,081 items/s\n 1.6x faster than HyperQ\n 2.3x faster than faster-fifo\n 7.0x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 16384 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 1.278 0.003 313,053 \nHyperQ 1.765 0.004 226,633 \nfaster-fifo 2.442 0.006 163,817 \nmultiprocessing.Queue 6.288 0.016 63,613 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 313,053 items/s\n 1.4x faster than HyperQ\n 1.9x faster than faster-fifo\n 4.9x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 32768 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 2.374 0.006 168,526 \nHyperQ 2.887 0.007 138,536 \nfaster-fifo 3.804 0.010 105,154 \nmultiprocessing.Queue 10.354 0.026 38,634 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 168,526 items/s\n 1.2x faster than HyperQ\n 1.6x faster than faster-fifo\n 4.4x faster than multiprocessing.Queue\nRunning bytes performance benchmarks...\n================================================================================\n\nResults for 100,000 messages of 32 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.018 0.000 5,528,243 \nHyperQ 0.090 0.001 1,106,593 \nmultiprocessing.Queue 0.334 0.003 299,499 \nfaster-fifo 0.406 0.004 246,330 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 5,528,243 items/s\n 5.0x faster than HyperQ\n 18.5x faster than multiprocessing.Queue\n 22.4x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 64 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.020 0.000 5,067,022 \nHyperQ 0.090 0.001 1,105,261 \nmultiprocessing.Queue 0.388 0.004 257,635 \nfaster-fifo 0.397 0.004 251,805 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 5,067,022 items/s\n 4.6x faster than HyperQ\n 19.7x faster than multiprocessing.Queue\n 20.1x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 128 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.025 0.000 3,988,545 \nHyperQ 0.102 0.001 984,694 \nmultiprocessing.Queue 0.332 0.003 301,471 \nfaster-fifo 0.402 0.004 248,764 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 3,988,545 items/s\n 4.1x faster than HyperQ\n 13.2x faster than multiprocessing.Queue\n 16.0x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 256 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.030 0.000 3,280,452 \nHyperQ 0.098 0.001 1,024,640 \nmultiprocessing.Queue 0.344 0.003 290,311 \nfaster-fifo 0.395 0.004 253,071 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 3,280,452 items/s\n 3.2x faster than HyperQ\n 11.3x faster than multiprocessing.Queue\n 13.0x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 512 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.028 0.000 3,550,212 \nHyperQ 0.105 0.001 956,745 \nmultiprocessing.Queue 0.357 0.004 279,993 \nfaster-fifo 0.420 0.004 238,251 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 3,550,212 items/s\n 3.7x faster than HyperQ\n 12.7x faster than multiprocessing.Queue\n 14.9x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 1024 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.042 0.000 2,390,645 \nHyperQ 0.109 0.001 917,085 \nmultiprocessing.Queue 0.379 0.004 263,922 \nfaster-fifo 0.413 0.004 241,983 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 2,390,645 items/s\n 2.6x faster than HyperQ\n 9.1x faster than multiprocessing.Queue\n 9.9x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 4096 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.077 0.001 1,296,410 \nHyperQ 0.153 0.002 653,955 \nmultiprocessing.Queue 0.420 0.004 238,116 \nfaster-fifo 0.437 0.004 228,823 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 1,296,410 items/s\n 2.0x faster than HyperQ\n 5.4x faster than multiprocessing.Queue\n 5.7x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 8192 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.107 0.001 936,460 \nHyperQ 0.203 0.002 492,091 \nmultiprocessing.Queue 0.497 0.005 201,165 \nfaster-fifo 0.539 0.005 185,473 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 936,460 items/s\n 1.9x faster than HyperQ\n 4.7x faster than multiprocessing.Queue\n 5.0x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 16384 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.189 0.002 528,889 \nHyperQ 0.303 0.003 329,876 \nmultiprocessing.Queue 0.658 0.007 152,017 \nfaster-fifo 0.762 0.008 131,168 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 528,889 items/s\n 1.6x faster than HyperQ\n 3.5x faster than multiprocessing.Queue\n 4.0x faster than faster-fifo\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 32768 bytes per producer:\nTotal messages: 100,000 (1 producers, 1 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.375 0.004 266,432 \nHyperQ 0.484 0.005 206,720 \nfaster-fifo 0.939 0.009 106,544 \nmultiprocessing.Queue 1.053 0.011 94,985 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 266,432 items/s\n 1.3x faster than HyperQ\n 2.5x faster than faster-fifo\n 2.8x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 32 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.097 0.000 4,142,198 \nHyperQ 0.313 0.001 1,276,678 \nfaster-fifo 0.863 0.002 463,335 \nmultiprocessing.Queue 2.907 0.007 137,604 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 4,142,198 items/s\n 3.2x faster than HyperQ\n 8.9x faster than faster-fifo\n 30.1x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 64 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.108 0.000 3,713,089 \nHyperQ 0.336 0.001 1,189,575 \nfaster-fifo 0.847 0.002 472,108 \nmultiprocessing.Queue 2.928 0.007 136,622 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 3,713,089 items/s\n 3.1x faster than HyperQ\n 7.9x faster than faster-fifo\n 27.2x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 128 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.104 0.000 3,838,310 \nHyperQ 0.293 0.001 1,365,044 \nfaster-fifo 0.880 0.002 454,557 \nmultiprocessing.Queue 2.968 0.007 134,779 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 3,838,310 items/s\n 2.8x faster than HyperQ\n 8.4x faster than faster-fifo\n 28.5x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 256 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.121 0.000 3,306,829 \nHyperQ 0.346 0.001 1,156,464 \nfaster-fifo 0.848 0.002 471,452 \nmultiprocessing.Queue 3.024 0.008 132,281 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 3,306,829 items/s\n 2.9x faster than HyperQ\n 7.0x faster than faster-fifo\n 25.0x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 512 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.139 0.000 2,870,961 \nHyperQ 0.413 0.001 968,493 \nfaster-fifo 0.892 0.002 448,522 \nmultiprocessing.Queue 3.143 0.008 127,257 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 2,870,961 items/s\n 3.0x faster than HyperQ\n 6.4x faster than faster-fifo\n 22.6x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 1024 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.209 0.001 1,918,401 \nHyperQ 0.546 0.001 732,611 \nfaster-fifo 0.929 0.002 430,677 \nmultiprocessing.Queue 3.299 0.008 121,240 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 1,918,401 items/s\n 2.6x faster than HyperQ\n 4.5x faster than faster-fifo\n 15.8x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 4096 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.400 0.001 1,001,018 \nHyperQ 0.745 0.002 536,564 \nfaster-fifo 1.176 0.003 340,031 \nmultiprocessing.Queue 4.032 0.010 99,196 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 1,001,018 items/s\n 1.9x faster than HyperQ\n 2.9x faster than faster-fifo\n 10.1x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 8192 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 0.679 0.002 589,081 \nHyperQ 1.111 0.003 359,917 \nfaster-fifo 1.554 0.004 257,363 \nmultiprocessing.Queue 4.742 0.012 84,353 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 589,081 items/s\n 1.6x faster than HyperQ\n 2.3x faster than faster-fifo\n 7.0x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 16384 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 1.278 0.003 313,053 \nHyperQ 1.765 0.004 226,633 \nfaster-fifo 2.442 0.006 163,817 \nmultiprocessing.Queue 6.288 0.016 63,613 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 313,053 items/s\n 1.4x faster than HyperQ\n 1.9x faster than faster-fifo\n 4.9x faster than multiprocessing.Queue\n\n================================================================================\nSleeping 2 seconds before next test configuration...\n\nResults for 100,000 messages of 32768 bytes per producer:\nTotal messages: 400,000 (4 producers, 4 consumers)\n--------------------------------------------------------------------------------\nQueue Type Total Time (s) Latency (ms) Throughput (items/s)\n--------------------------------------------------------------------------------\nBytesHyperQ 2.374 0.006 168,526 \nHyperQ 2.887 0.007 138,536 \nfaster-fifo 3.804 0.010 105,154 \nmultiprocessing.Queue 10.354 0.026 38,634 \n\n\ud83c\udfc6 Fastest: BytesHyperQ with 168,526 items/s\n 1.2x faster than HyperQ\n 1.6x faster than faster-fifo\n 4.4x faster than multiprocessing.Queue\n```\n\n*Results may vary depending on hardware and system configuration.*\n\n## \ud83d\udd27 API Reference\n\n### HyperQ\n\n```python\nclass HyperQ:\n def __init__(self, capacity: int, name: str = None)\n\n def put(self, item) -> bool\n def get(self) # Blocks until data is available\n def empty(self) -> bool\n def full(self) -> bool\n def size(self) -> int\n def clear(self)\n```\n\n### BytesHyperQ\n\n```python\nclass BytesHyperQ:\n def __init__(self, capacity: int, name: str = None)\n\n def put(self, data: bytes) -> bool\n def get(self) -> bytes # Blocks until data is available\n def empty(self) -> bool\n def full(self) -> bool\n def size(self) -> int\n def clear(self)\n```\n\n### Parameters\n\n- **capacity**: Maximum size of the queue in bytes\n- **name**: Optional name for the shared memory segment (max 28 characters)\n\n### Important Notes\n\n- **Blocking operations**: `get()` blocks indefinitely until data is available\n- **No timeout support**: Currently no timeout functionality is implemented\n- **Queue names**: Must be 28 characters or less\n- **Platform limitation**: Only works on Unix-like systems (Linux/macOS)\n\n## \ud83e\uddea Running Tests\n\n```bash\n# Run all tests\npytest\n\n# Run with coverage\npytest --cov=hyperq\n```\n\n## \ud83d\udcc8 Running Benchmarks\n\n```bash\npython benchmarks/benchmark_bytes_transfering.py\n```\n\n## \ud83c\udfd7\ufe0f Building from Source\n\n### Prerequisites\n\n- Python 3.10+\n- Cython >= 0.29.0\n- C++ compiler with C++20 support (GCC 8+, Clang 10+)\n- Unix-like system (Linux or macOS)\n\n### Build Steps\n\n```bash\n# Clone the repository\ngit clone https://github.com/martinmkhitaryan/hyperq.git\ncd hyperq\n\n# Install build dependencies\npip install -e \".[test]\"\n\n# Build the extension\npython setup.py build_ext --inplace\n```\n\n## \ud83e\udd1d Contributing\n\n### Development Setup\n\n1. Fork the repository\n2. Create a virtual environment: `python -m venv .venv`\n3. Activate it: `source .venv/bin/activate` (Linux/macOS)\n4. Install development dependencies: `pip install -e \".[test]\"`\n5. Run tests: `pytest`\n6. Make your changes and submit a pull request\n\n## \ud83d\udcdd License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\ude4f Acknowledgments\n\n- Built with [Cython](https://cython.org/) for high-performance Python extensions\n- Uses POSIX shared memory and threading primitives\n- Inspired by the need for faster inter-process communication in Python\n\n## \ud83d\udcde Support\n\n- **Issues**: [GitHub Issues](https://github.com/martinmkhitaryan/hyperq/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/martinmkhitaryan/hyperq/discussions)\n- **Email**: mkhitaryan.martin@2000gmail.com\n\n## \ud83d\udd04 Version History\n- **1.0.0**: First working version on Linux and macOS (single producer and single consumer only; multiple producers or consumers not supported).\n- **0.1.0**: Refactored constructor and destructor in hyperq.hpp; reference count via atomic variable.\n- **0.0.9**: Updated benchmarks in README.md.\n- **0.0.8**: Updated benchmark suite, test suite, pyproject.toml configuration; optimized CI/CD release workflow.\n- **0.0.7**: Replaced is_creator logic with ref count logic for better shared memory management; identified and documented issue with multiprocessing spawn start method not working properly with multiple consumers and producers.\n- **0.0.6**: Fix cibuildwheel configurations.\n- **0.0.5**: Added platform-specific build and skip patterns for Linux and macOS; improved cibuildwheel configuration with separate build targets for manylinux and macosx wheels\n- **0.0.4**: Fixed cibuildwheel configuration for proper multi-platform wheel builds; added architecture-specific settings for Linux (x86_64/i686) and macOS (x86_64/arm64);\n- **0.0.3**: Fixed cibuildwheel configuration for proper linux wheel build;\n- **0.0.2**: Added proper PyPI wheel support for Linux and macOS using cibuildwheel; improved release workflow for multi-platform builds and C++20 compatibility\n- **0.0.1**: Initial release with HyperQ and BytesHyperQ implementations\n---\n",
"bugtrack_url": null,
"license": null,
"summary": "Hyper-fast queue for Python",
"version": "1.0.0",
"project_urls": {
"Bug Tracker": "https://github.com/martinmkhitaryan/hyperq/issues",
"Discussions": "https://github.com/martinmkhitaryan/hyperq/discussions",
"Documentation": "https://github.com/martinmkhitaryan/hyperq#readme",
"Homepage": "https://github.com/martinmkhitaryan/hyperq",
"Repository": "https://github.com/martinmkhitaryan/hyperq"
},
"split_keywords": [
"queue",
" hyper",
" hyper-queue",
" hyperqueue",
" high-performance",
" inter-process-communication",
" ipc",
" shared-memory",
" ring-buffer",
" multiprocessing",
" threading",
" cython",
" c++",
" python",
" fast",
" low-latency",
" concurrent",
" synchronization",
" posix",
" unix",
" linux",
" macos"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "318c46f403b99cfddb05e3b2b227c0772e9afe4bbc3141d8dbf8311e64327770",
"md5": "4950d9cd2580c5d8ebe6502086f7f9cf",
"sha256": "78c48838392bbe25781bb854422a5c77f6ea202586d445c19214a93ea3beca47"
},
"downloads": -1,
"filename": "hyperq-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "4950d9cd2580c5d8ebe6502086f7f9cf",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 139900,
"upload_time": "2025-08-24T20:57:12",
"upload_time_iso_8601": "2025-08-24T20:57:12.880833Z",
"url": "https://files.pythonhosted.org/packages/31/8c/46f403b99cfddb05e3b2b227c0772e9afe4bbc3141d8dbf8311e64327770/hyperq-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ed007477a145b7bab0f2caa64955b56e14e4a90b9be58bf89320cd4af76da2e4",
"md5": "7be04200a3ccd62a3b927cac965e3f25",
"sha256": "d230c8a817f9cb8cce1fa35d4c01ab603efa7ddd66583ef37727d255646bfc0a"
},
"downloads": -1,
"filename": "hyperq-1.0.0-cp310-cp310-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "7be04200a3ccd62a3b927cac965e3f25",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 138666,
"upload_time": "2025-08-24T20:57:14",
"upload_time_iso_8601": "2025-08-24T20:57:14.848848Z",
"url": "https://files.pythonhosted.org/packages/ed/00/7477a145b7bab0f2caa64955b56e14e4a90b9be58bf89320cd4af76da2e4/hyperq-1.0.0-cp310-cp310-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8030ab207ac227c69b8a77c333695e57cebf51eb9360e819c79a4f255fd6efa5",
"md5": "3e1a1c6a339282ef8748ee9b9ee1a862",
"sha256": "27f74686146a43e9cf4b08cba1f380ec3acef08f63f3e8bb1b596fbc0fe1a792"
},
"downloads": -1,
"filename": "hyperq-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "3e1a1c6a339282ef8748ee9b9ee1a862",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 181784,
"upload_time": "2025-08-24T20:57:16",
"upload_time_iso_8601": "2025-08-24T20:57:16.794615Z",
"url": "https://files.pythonhosted.org/packages/80/30/ab207ac227c69b8a77c333695e57cebf51eb9360e819c79a4f255fd6efa5/hyperq-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f60906df36fc22c5afa62f41faad2d61022185fd3229fb58caf0393d70ea8461",
"md5": "220a308caea3d5d536db8f08b81eab7e",
"sha256": "f5c7d98aecad757481a06bddc1594037801be5da4864382fc34081d959bb0044"
},
"downloads": -1,
"filename": "hyperq-1.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl",
"has_sig": false,
"md5_digest": "220a308caea3d5d536db8f08b81eab7e",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 186958,
"upload_time": "2025-08-24T20:57:18",
"upload_time_iso_8601": "2025-08-24T20:57:18.696787Z",
"url": "https://files.pythonhosted.org/packages/f6/09/06df36fc22c5afa62f41faad2d61022185fd3229fb58caf0393d70ea8461/hyperq-1.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e3ef6ad143f99a4fef338125eae902f69a0af6f46f0aec0ce0a58f39fe717bdb",
"md5": "50c6943666d7151a4f7ad2b55fad0ebe",
"sha256": "6989ac225e9112fcd47a8c11b5919eabbd06ab15d206793b1ee10f7acaceaeb4"
},
"downloads": -1,
"filename": "hyperq-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "50c6943666d7151a4f7ad2b55fad0ebe",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.10",
"size": 140591,
"upload_time": "2025-08-24T20:57:20",
"upload_time_iso_8601": "2025-08-24T20:57:20.496751Z",
"url": "https://files.pythonhosted.org/packages/e3/ef/6ad143f99a4fef338125eae902f69a0af6f46f0aec0ce0a58f39fe717bdb/hyperq-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f2895ca01b867ae9e7af867aa5b26bc7d84c34b5098276c42c59a8f8fad1a281",
"md5": "0a7931a979c46225cb79beb6507fec71",
"sha256": "5a0ad125ce79438ee8daf5236ef46ec4bacb7abfb53ab5f574b2bf9fa38d008c"
},
"downloads": -1,
"filename": "hyperq-1.0.0-cp311-cp311-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "0a7931a979c46225cb79beb6507fec71",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.10",
"size": 139163,
"upload_time": "2025-08-24T20:57:22",
"upload_time_iso_8601": "2025-08-24T20:57:22.163174Z",
"url": "https://files.pythonhosted.org/packages/f2/89/5ca01b867ae9e7af867aa5b26bc7d84c34b5098276c42c59a8f8fad1a281/hyperq-1.0.0-cp311-cp311-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "dab7a7c69fc4ab5053c00225103c3bd960d10a2b89a9d4c3c9c58a73c33f1497",
"md5": "a1eadce84c25b3fef8eeb227614326e2",
"sha256": "7e20bd42c4c36289d16f174df9fe10acc2ed1e0b3fc67d7d6e4899c604df9126"
},
"downloads": -1,
"filename": "hyperq-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "a1eadce84c25b3fef8eeb227614326e2",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.10",
"size": 181202,
"upload_time": "2025-08-24T20:57:23",
"upload_time_iso_8601": "2025-08-24T20:57:23.983394Z",
"url": "https://files.pythonhosted.org/packages/da/b7/a7c69fc4ab5053c00225103c3bd960d10a2b89a9d4c3c9c58a73c33f1497/hyperq-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "5b99065cb5c5e59721edd582bd5cf36ba49210a706907ea7008be26dbb5e75b9",
"md5": "6990af42176f456de94ae73f4ba5c11a",
"sha256": "7ad5deb137eba2224d0c5bbbb226c15e953cd6c55235ec215c4f2e821776bd0c"
},
"downloads": -1,
"filename": "hyperq-1.0.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl",
"has_sig": false,
"md5_digest": "6990af42176f456de94ae73f4ba5c11a",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.10",
"size": 186576,
"upload_time": "2025-08-24T20:57:25",
"upload_time_iso_8601": "2025-08-24T20:57:25.791492Z",
"url": "https://files.pythonhosted.org/packages/5b/99/065cb5c5e59721edd582bd5cf36ba49210a706907ea7008be26dbb5e75b9/hyperq-1.0.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "57f9d8c674d0d02ee6cf0900afd388c78d2ef9642b28b22d4ee7211a697ab625",
"md5": "884e7881b616567098411d3a8a974e61",
"sha256": "640ba2f02a324fe9d394487b120684dfad4710fffab643012a82d0e5f54844ea"
},
"downloads": -1,
"filename": "hyperq-1.0.0-cp312-cp312-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "884e7881b616567098411d3a8a974e61",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.10",
"size": 141822,
"upload_time": "2025-08-24T20:57:27",
"upload_time_iso_8601": "2025-08-24T20:57:27.138421Z",
"url": "https://files.pythonhosted.org/packages/57/f9/d8c674d0d02ee6cf0900afd388c78d2ef9642b28b22d4ee7211a697ab625/hyperq-1.0.0-cp312-cp312-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "5594870a25b72575a90263c6e9cd7f3ec95b410b317af9069a79dc8080b0ed97",
"md5": "2a5c197bab1aa138e4403220bd5a779d",
"sha256": "d9283dacf650666fb0d8dd64b4aadecf97d427f734fa0fb22402147d2907396d"
},
"downloads": -1,
"filename": "hyperq-1.0.0-cp312-cp312-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "2a5c197bab1aa138e4403220bd5a779d",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.10",
"size": 139882,
"upload_time": "2025-08-24T20:57:28",
"upload_time_iso_8601": "2025-08-24T20:57:28.851871Z",
"url": "https://files.pythonhosted.org/packages/55/94/870a25b72575a90263c6e9cd7f3ec95b410b317af9069a79dc8080b0ed97/hyperq-1.0.0-cp312-cp312-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b0ad039c5864a9faacbd82eac127fb0b26a470544f5118ebf0ae8bf9d908ca98",
"md5": "ab5e3d22dc02aab2765bb32d4d082f9c",
"sha256": "c8f807cb23dabb5ac675e1144d501c1f17549699d2a2f3e15f1a52a501461869"
},
"downloads": -1,
"filename": "hyperq-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "ab5e3d22dc02aab2765bb32d4d082f9c",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.10",
"size": 182212,
"upload_time": "2025-08-24T20:57:30",
"upload_time_iso_8601": "2025-08-24T20:57:30.626744Z",
"url": "https://files.pythonhosted.org/packages/b0/ad/039c5864a9faacbd82eac127fb0b26a470544f5118ebf0ae8bf9d908ca98/hyperq-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "da0f96a7ec47e03198c953455f832f0f8ab5e3f2f1b8722990f2710000b028a4",
"md5": "c942e5f2a92cc3e655522ec62afaf1f5",
"sha256": "299ba6da3f0d8eae7f4353e05dfe303d309c17598bd4b678d3a13f67cdd6130f"
},
"downloads": -1,
"filename": "hyperq-1.0.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl",
"has_sig": false,
"md5_digest": "c942e5f2a92cc3e655522ec62afaf1f5",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.10",
"size": 186741,
"upload_time": "2025-08-24T20:57:32",
"upload_time_iso_8601": "2025-08-24T20:57:32.474278Z",
"url": "https://files.pythonhosted.org/packages/da/0f/96a7ec47e03198c953455f832f0f8ab5e3f2f1b8722990f2710000b028a4/hyperq-1.0.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "107efd30d628cbfa0849df4f012c7ddbbe602d4be9d2673f6addc5773c936fa5",
"md5": "65461492d37cd67371d656d63ad20623",
"sha256": "9f985e73f12785e575776a941750d9e8666c2de1059aff2e21e4e1c59195dff3"
},
"downloads": -1,
"filename": "hyperq-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "65461492d37cd67371d656d63ad20623",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 110885,
"upload_time": "2025-08-24T20:57:34",
"upload_time_iso_8601": "2025-08-24T20:57:34.200000Z",
"url": "https://files.pythonhosted.org/packages/10/7e/fd30d628cbfa0849df4f012c7ddbbe602d4be9d2673f6addc5773c936fa5/hyperq-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-24 20:57:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "martinmkhitaryan",
"github_project": "hyperq",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "hyperq"
}