248,524
Python IPC q/s
socket plus JSON path
122,000
PyO3 q/s
extension path
16,000
asyncpg q/s
sequential baseline
10 Million Query Results
| Driver | Queries/s | Relative to PyO3 | Notes |
|---|---|---|---|
| Python IPC | 248,524 | 2.0x | Pure Python, socket plus JSON |
| PyO3 (current qail-py) | 122,000 | baseline | Rust FFI with GIL handoff |
| asyncpg | 16,000 | 0.13x | Sequential queries |
Interpretation
In this workload, the Python socket client to qail-daemon reached 248,524 q/s while the PyO3 path reached 122,000 q/s. Treat the number as a transport-boundary measurement tied to this prepared-statement pattern rather than a language-wide claim.
Reference Client Shape
from qail_ipc import connect
client = connect()
client.connect_pg("localhost", 5432, "user", "db", "")
handle = client.prepare("SELECT id, name FROM users LIMIT $1")
params = [["10"], ["5"], ["1"]] * 3333
count = client.prepared_pipeline(handle, params) Transport Notes
| Aspect | PyO3 (FFI) | IPC (socket) |
|---|---|---|
| GIL handling | Explicit thread handoff | Automatic under socket I/O |
| Build coupling | Requires maturin plus Rust | Pure Python client package |
| Memory boundary | Shared Python/Rust heap | Process boundary |
| Prepared statements | Limited cache scope | Daemon-wide cache |
Transport Snapshot Across Languages
| Runtime | IPC queries/s | Relative note |
|---|---|---|
| Python IPC | 248,524 | 2.0x vs PyO3 |
| Go IPC | 237,561 | 0.99x vs pgx |
| Rust baseline | 355,000 | workspace baseline |
Variance note
The Python and Go IPC numbers were within roughly 5% in separate harnesses. Treat that as directional only because client runtime behavior and measurement variance differ between the two runs.
Interpretation summary
- The report compares two Python transport boundaries under the same prepared workload shape.
- The daemon cache kept the socket path materially above the sequential asyncpg baseline shown here.
- The socket boundary separates the Python process from the Rust executor.
- Rerun on your own workload before using the ratio in production planning.