0.79x
SQLx / qail-pg
3,573 vs 4,534 q/s
0.89x
SeaORM / qail-pg
4,032 vs 4,534 q/s
221us
qail-pg latency
cached path
Measured Results
| Driver | Queries/s | Latency | Normalized throughput |
|---|---|---|---|
| qail-pg (cached) | 4,534 q/s | 221us | 1.00x |
| SeaORM | 4,032 q/s | 248us | 0.89x |
| SQLx | 3,573 q/s | 280us | 0.79x |
| qail-pg (fast) | 3,531 q/s | 283us | 0.78x |
| qail-pg (basic) | 2,640 q/s | 379us | 0.58x |
Optimizations Applied (v0.14.4)
- Reusable
sql_bufandparams_bufonPgConnectionremove hot-path heap allocation. - The statement cache is bounded with an LRU policy and automatic eviction.
- Parameterized LIMIT/OFFSET keeps identical SQL text on cache hits.
- Prepared statements are keyed by SQL hash so Parse is skipped when the cache hits.
Query Shape
WITH high_earners AS (
SELECT * FROM employees WHERE salary > 80000
)
SELECT e.*, d.name AS dept_name
FROM high_earners e
JOIN departments d ON e.department_id = d.id
WHERE e.status = 'active'
ORDER BY e.salary DESC
LIMIT 100 Reproduce
git clone https://github.com/qail-io/qail.git
cd qail
cargo run --example orm_benchmark --release