Skip to content

Performance

TaiDB is built for small, local, embedded workloads. Performance work should be measured with reproducible scripts and realistic data before making claims.

Run a large key-value benchmark:

Terminal window
taidb bench-large ./bench.taidb \
--items 100000 \
--value-size 512 \
--batch-size 4096

Run the mixed workload benchmark:

Terminal window
taidb bench-enterprise ./enterprise.taidb \
--items 100000 \
--value-size 1024 \
--vectors 10000 \
--vector-dims 64 \
--update-ops 50000 \
--reads 100000 \
--searches 250 \
--batch-size 4096

Both commands print JSON so results can be stored as CI artifacts or compared between versions.

Run a focused compression benchmark:

Terminal window
taidb bench-compression ./compression-bench \
--items 50000 \
--value-size 1024 \
--batch-size 4096 \
--min-bytes 256 \
--dense-level 19

This compares no compression, zstd-fast, and zstd-dense. The JSON report includes write speed, read speed, verify speed, file size, compression ratio, and space saved percentage for each mode.

Record at least:

  • TaiDB version and Git commit.
  • Rust toolchain.
  • CPU, memory, OS, and filesystem.
  • database path location.
  • durability mode.
  • compression mode and zstd level.
  • encryption mode.
  • item count, value size, vector count, vector dimensions, and batch size.

Without this context, benchmark numbers are hard to reproduce.

Buffered and flush-oriented modes can be faster than fully synced writes, but they provide different crash behavior. Do not compare write throughput unless durability settings are explicit.

CLI example:

Terminal window
taidb --sync put ./safe.taidb key value

Rust example:

use taidb::{Durability, EngineConfig};
let db = EngineConfig::new("./safe.taidb")
.durability(Durability::Sync)
.open()?;

Compression can reduce file size and I/O, but it can also increase CPU cost. Measure both file size and wall-clock time.

Recommended comparisons:

  • no compression
  • zstd-fast
  • zstd-dense
  • encrypted plus zstd-fast
  • encrypted without compression

TaiDB should not claim broad superiority over SQLite, Berkeley DB, LevelDB, or RocksDB without public scripts and repeatable evidence. Comparisons should be limited to workloads where TaiDB has a clear purpose, such as a local embedding cache with exact vector search and simple key-value metadata.