Performance
TaiDB is built for small, local, embedded workloads. Performance work should be measured with reproducible scripts and realistic data before making claims.
Built-in benchmark commands
Section titled “Built-in benchmark commands”Run a large key-value benchmark:
taidb bench-large ./bench.taidb \ --items 100000 \ --value-size 512 \ --batch-size 4096Run the mixed workload benchmark:
taidb bench-enterprise ./enterprise.taidb \ --items 100000 \ --value-size 1024 \ --vectors 10000 \ --vector-dims 64 \ --update-ops 50000 \ --reads 100000 \ --searches 250 \ --batch-size 4096Both commands print JSON so results can be stored as CI artifacts or compared between versions.
Run a focused compression benchmark:
taidb bench-compression ./compression-bench \ --items 50000 \ --value-size 1024 \ --batch-size 4096 \ --min-bytes 256 \ --dense-level 19This 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.
Measure the right variables
Section titled “Measure the right variables”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.
Durability vs speed
Section titled “Durability vs speed”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:
taidb --sync put ./safe.taidb key valueRust example:
use taidb::{Durability, EngineConfig};
let db = EngineConfig::new("./safe.taidb") .durability(Durability::Sync) .open()?;Compression vs speed
Section titled “Compression vs speed”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
Comparison policy
Section titled “Comparison policy”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.