HeliosDB-Full Performance Evolution vs PostgreSQL
Benchmark: 1000 rows, 5 columns (INT, TEXT, TEXT, INT, TEXT), PRIMARY KEY on id
PostgreSQL: 16.11 (Docker), HeliosDB: v7.1.0 (compiled binary)
Date: 2026-02-14
Latest Results — All Clients (same session, same system load)
| Test | PostgreSQL | Python→Helios | Rust→Helios | Direct API |
|---|
| Point Lookups | 132us | 75us | 90us | 1us |
| Full Scan | 859us | 323us | 751us | 628us |
| Aggregates | 148us | 55us | 83us | 224us |
| INSERT | 481us | 75us | 93us | 2us |
| UPDATE | 466us | 83us | 87us | 3us |
| DELETE | 450us | 70us | 71us | 2us |
| Mixed OLTP | 271us | 82us | 73us | 1us |
Win/Loss vs PostgreSQL (latest run)
| Test | Python→Helios | Rust→Helios | Direct API |
|---|
| Point Lookups | 1.8x W | 1.5x W | 132x W |
| Full Scan | 2.7x W | 1.1x W | 1.4x W |
| Aggregates | 2.7x W | 1.8x W | 1.5x L |
| INSERT | 6.4x W | 5.2x W | 241x W |
| UPDATE | 5.6x W | 5.4x W | 155x W |
| DELETE | 6.5x W | 6.3x W | 225x W |
| Mixed OLTP | 3.3x W | 3.7x W | 271x W |
| Score | 7W / 0L | 7W / 0L | 6W / 1L |
Historical Optimization Rounds (avg latency, microseconds)
| Test | PostgreSQL | Baseline | Round 1 | Round 2 | Round 3 | Round 4 | Round 5 | Round 6 |
|---|
| Point Lookups | 110us | 72us | 57us | 65us | 57us | 155us | 182us | 75us |
| Full Scan | 723us | 7000us | 1200us | 1100us | 1100us | 1400us | 1300us | 323us |
| Aggregates | 136us | 871us | 692us | 381us | 279us | 420us | 90us | 55us |
| INSERT | 450us | 860us | 733us | 70us | 66us | 212us | 233us | 75us |
| UPDATE | 515us | 1600us | 560us | 78us | 80us | 183us | 275us | 83us |
| DELETE | 571us | 1600us | 551us | 62us | 92us | 184us | 215us | 70us |
| Mixed OLTP | 285us | 921us | 541us | 215us | 67us | 215us | 275us | 82us |
| Score | — | 1W/6L | 1W/6L | 5W/2L | 5W/2L | 6W/1L | 7W/0L | 7W/0L |
PostgreSQL column uses Baseline-run PG values. Rounds ran on different system loads; relative improvements are the key metric.
Client Comparison
| Client | Protocol | Overhead | Best For |
|---|
| Python (psycopg2) | PG wire (TCP) | Python runtime + C extension | Standard benchmarking |
| Rust (tokio-postgres) | PG wire (TCP, simple query) | Minimal (async Rust) | Low-overhead wire protocol |
| Direct API | None (in-process) | Zero network/protocol | Maximum throughput |
Optimization Rounds
Baseline (commit 0bf96ff4)
- Point lookup fast path (pk_index)
- TCP_NODELAY
- Equal PK conditions on both databases
Round 1 (commit d47f8c64) — 6 Optimizations
- PK index fast path for UPDATE/DELETE (O(1) instead of table scan)
- Batched DataRow wire writes (single
write_all())
- Streaming aggregates (single-pass, no materialization)
- Stack-allocated integer formatting (
itoa)
- Skip autocommit INSERT overhead
- Direct StoredRow-to-wire encoding
Round 2 (commit d90bc32e) — Write Path Revolution
- DirectIoWal group commit (batch 256 entries / 5ms, eliminating per-write fsync)
- COUNT(*) ultra-fast path (zero decode)
decode_values_only with raw MessagePack parser
- Single-column numeric extraction for SUM/AVG
Round 3 (commit cf5f8649) — COUNT(*) via pk_index
- Pre-scan COUNT(*) uses
pk_index.len() — O(1), no LSM scan
- Raw MessagePack column extractor for partial decode
Round 4 (commit 970d8d0d) — Zero-Allocation Full Scan
- Raw MessagePack to PostgreSQL wire format directly (bypasses serde + StoredValue + ParameterValue)
pending_wire_buf field for pre-built DataRow buffer
- Full Scan flipped from PostgreSQL winning to HeliosDB winning
Round 5 (commit 702f6b12) — Incremental Aggregate Accumulators
TableAggregates struct: per-column running SUM/COUNT maintained on every INSERT/UPDATE/DELETE
- O(1) aggregate lookups for COUNT/SUM/AVG without WHERE clause
- Scan cache with write-invalidation (500ms TTL)
- Aggregates flipped from PostgreSQL 1.8x faster to HeliosDB 3.2x FASTER
- Cache pre-built PostgreSQL DataRow buffer (wire_cache) instead of raw scan data
- On cache hit: clone ~60KB wire bytes directly → zero scan, zero decode, zero encode
- Full Scan flipped from 2.3x LOSS to 2.7x WIN (1.7ms → 323us)
- HeliosDB wins all 7/7 categories across all client types
Rust Benchmark Binary (commit 6b66f1f7)
heliosdb-bench --mode rust-client: tokio-postgres simple query protocol
heliosdb-bench --mode direct: Zero-network LsmStorageEngine API
heliosdb-bench --mode both: Run both modes sequentially
Key Techniques Summary
| Optimization | Impact | Category |
|---|
| Direct API (no network) | 132-271x point ops | All categories |
| DirectIoWal group commit | 6-13x write speedup | INSERT/UPDATE/DELETE |
| pk_index O(1) lookup | 3-10x point ops | Point/UPDATE/DELETE |
| Wire-format cache | 5.3x scan speedup | Full Scan |
| Incremental aggregates | 2-7x aggregate speedup | Aggregates |
| Zero-alloc MessagePack→wire | 1.5x scan speedup | Full Scan |
| Batched wire writes | 1.3x output speedup | Full Scan/Aggregates |
| Skip autocommit overhead | 1.2x write speedup | INSERT |
| Scan cache (500ms TTL) | Avoids repeated LSM scans | Mixed OLTP |