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 & Method | Parameter (records) | Mode | JMH Score (ops/s) | Error Margin | Benchmark Operation Scope |
|---|---|---|---|---|---|
MemtablePutBenchmark.put | N/A | Throughput | 40,769,881.228 | ± 24,019,114.386 | 1 Single Key-Value Record Insert (~24.5 ns/op) |
TangoPutBenchmark.put | N/A | Throughput | 1,545.959 | ± 500.907 | 1 Full End-to-End Put (WAL Sync + MemTable) |
SstManagerReadBenchmark.read | N/A | Throughput | 512.502 | ± 3,871.974 | 1 Indexed SSTable Point Read (Bloom Filter + Sparse Index) |
SstManagerWriteBenchmark.write | 1,000 | Throughput | 447.738 | ± 1,458.170 | 1 Complete SSTable Flush (1,000 records) |
SstManagerWriteBenchmark.write | 10,000 | Throughput | 290.835 | ± 66.841 | 1 Complete SSTable Flush (10,000 records) |
SstManagerWriteBenchmark.write | 100,000 | Throughput | 59.042 | ± 1.272 | 1 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
- 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. - 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.
- Positional Reads: Refactored
SstReaderto use positionalFileChannel.read, completely eliminating native OSmmapmemory 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