Skip to main content

Benchmark Results

All benchmarks run against a debug build (cargo run --bin benchmark_compare) on a local macOS machine. RookDB is compared to a local PostgreSQL instance.


Setup

ParameterValue
Rows100 000
Iterations5
Update predicateid <= 50000
Update assignmentscore = score + 10
Delete predicateid <= 20000
Build profiledebug
PostgreSQL schemapublic

The RookDB seed file (100 000 rows) is copied fresh before each iteration so every sample starts from an identical table state.


RookDB Summary (debug build, rook-only)

OperationAverageFastestSlowestTotal
UPDATE3 310.813 ms3 128.560 ms3 463.800 ms16 554.066 ms
DELETE98.649 ms97.017 ms101.215 ms493.244 ms
COMPACTION17.747 ms13.284 ms31.394 ms88.737 ms

PostgreSQL Baseline (same conditions)

OperationAverageFastestSlowestTotal
UPDATE201.111 ms168.552 ms233.010 ms1 005.556 ms
DELETE5.224 ms4.902 ms6.248 ms26.120 ms
VACUUM (std)5.158 ms4.535 ms6.577 ms25.789 ms
VACUUM FULL40.812 ms39.361 ms42.185 ms204.061 ms

RookDB vs PostgreSQL — Average Latency Comparison

OperationRookDB avgPostgreSQL avgResult
UPDATE3 310.813 ms201.111 msPostgreSQL ~16.5× faster
DELETE98.649 ms5.224 msPostgreSQL ~18.9× faster
COMPACTION vs std VACUUM17.747 ms5.158 msPostgreSQL ~3.4× faster
COMPACTION vs VACUUM FULL17.747 ms40.812 msRookDB ~2.3× faster

Compaction Analysis

Compaction Comparison - RookDB vs VACUUM vs VACUUM FULL

RookDB compaction is a full page rewrite — it visits every page that has dead tuples and rewrites it from scratch. This is architecturally equivalent to PostgreSQL's VACUUM FULL (which also rewrites the entire table and holds an exclusive lock). Against that baseline, RookDB is ~2.3× faster.

PostgreSQL's standard VACUUM is an incremental lazy sweep — it reclaims dead tuple slots in-place without rewriting the full page, which is why it completes in ~5 ms. RookDB does not yet have an equivalent incremental mode.


UPDATE Analysis

Benchmark Charts

RookDB UPDATE is significantly slower because each matched row requires:

  1. A page-level write lock acquisition.
  2. A soft-delete of the old slot.
  3. An FSM-guided heap insertion for the new version (which may land on a different page).

PostgreSQL's UPDATE is an in-place MVCC version replacement that avoids an extra heap insert for rows that fit in the same page.


How to Reproduce

# RookDB-only benchmark (no PostgreSQL required)
cd code
cargo run --bin benchmark_compare -- --rook-only

# Full comparison against local PostgreSQL
cargo run --bin benchmark_compare -- \
--pg-url "postgresql://<user>@localhost:5432/postgres" \
--pg-schema "public"