Skip to main content

Performance & JMH Benchmarks (v1.0.0)

TangoDB uses the Java Microbenchmark Harness (JMH) to empirically measure, analyze, and validate engine throughput, native allocation overheads, and disk serialization speeds.


Benchmark Results Summary (v1.0.0)​

The table below reports raw JMH microbenchmark throughput scores (ops/s) captured from benchmark runs stored in benchmark_screenshot/v1.0.0/jmh_benchmark_results.txt.

Benchmark Class & MethodParameter (records)ModeJMH Score (ops/s)Error MarginBenchmark Operation Scope
MemtablePutBenchmark.putN/AThroughput40,769,881.228± 24,019,114.3861 Single Key-Value Record Insert (~24.5 ns/op)
TangoPutBenchmark.putN/AThroughput1,545.959± 500.9071 Full End-to-End Put (WAL Sync + MemTable)
SstManagerReadBenchmark.readN/AThroughput512.502± 3,871.9741 Indexed SSTable Point Read (Bloom Filter + Sparse Index)
SstManagerWriteBenchmark.write1,000Throughput447.738± 1,458.1701 Complete SSTable Flush (1,000 records)
SstManagerWriteBenchmark.write10,000Throughput290.835± 66.8411 Complete SSTable Flush (10,000 records)
SstManagerWriteBenchmark.write100,000Throughput59.042± 1.2721 Complete SSTable Flush (100,000 records)

1. MemTable In-Memory Ingest Benchmark​

MemtablePutBenchmark.put measures single-threaded key-value put() operations into off-heap MemTable memory segments managed via Java's Foreign Function & Memory (FFM) API (MemorySegment and Arena).

Execution Details & Environment​

  • JMH Harness Version: 1.37
  • JVM Runtime: OpenJDK 21 (64-Bit Server VM, Oracle Corp JDK 21.0.8+12-LTS-250)
  • OS / Environment: Windows AMD64
  • Flags: --enable-preview --enable-native-access=ALL-UNNAMED

Raw JMH Output​

Benchmark Mode Cnt Score Error Units
MemtablePutBenchmark.put thrpt 3 40769881.228 ± 24019114.386 ops/s
  • JMH Score: 40,769,881 ops/sec (~40.77 Million single key-value record puts per second)
  • Latency: ~24.5 nanoseconds per operation

2. SSTable Indexed Read Benchmark (Bloom Filter & Sparse Index)​

SstManagerReadBenchmark.read measures point read throughput across .sgdb SSTable files on disk.

Architectural Drivers​

  1. O(1) Fast Negative Rejection: Embedded a 1% false-positive rate Bloom Filter (Bfilter). Queries for non-existent keys are rejected in nanoseconds without reading disk blocks.
  2. O(log(N/16)) Binary Search: Sampled Sparse Index entries every 16 records allow readers to binary search key intervals and jump directly to the target 16-record chunk on disk.
  3. Positional Reads: Refactored SstReader to use positional FileChannel.read, completely eliminating native OS mmap memory leaks and Windows file locking retention.
Benchmark Mode Cnt Score Error Units
SstManagerReadBenchmark.read thrpt 3 512.502 ± 3871.974 ops/s

The Optimization Journey​

Phase 1: Heap Allocations Phase 2: FFM Native Segments Phase 3: Bloom Filter & Sparse Index
┌──────────────────────────┐ ┌──────────────────────────┐ ┌──────────────────────────┐
│ On-heap allocations │───►│ Move record payload │───►│ Pre-allocate 64 MiB │
│ induced GC pauses under │ │ off-heap via FFM │ │ Arenas, ThreadLocal key │
│ high write throughput. │ │ MemorySegments. │ │ lookups & Sparse Index. │
└──────────────────────────┘ └──────────────────────────┘ └──────────────────────────┘
│
▼
40.7M+ ops/sec MemTable Put
512.5 ops/sec Indexed SSTable Read