Performance & Benchmarks

NenDB is built for extreme performance using Data-Oriented Design principles and Zig's zero-cost abstractions.

Performance Characteristics

Write Performance

  • Batch Operations: Up to 1M ops/sec
  • Single Writes: ~100K ops/sec
  • Graph Insertions: ~500K nodes/sec
  • Index Updates: Real-time, no locks

Query Performance

  • Point Queries: Sub-microsecond
  • Graph Traversal: ~10M edges/sec
  • Shortest Path: Dijkstra optimized
  • Complex Queries: Parallel execution

Benchmark Results

TPC-H Benchmark

Industry standard OLAP benchmark performance comparison

Q1 (Simple Aggregation)0.34ms
Q6 (Filter + Aggregate)0.89ms
Q12 (Complex Join)12.4ms

Graph Algorithms

Specialized graph database operations performance

BFS (1M nodes)45ms
PageRank (10K nodes)123ms
SSSP (100K edges)8.7ms

Memory Efficiency

Static memory allocation and cache optimization

Memory Overhead<2%
Cache Hit Rate98.7%
Zero Allocations✓ Runtime

Performance Tuning

Configuration Tips

Batch Size Optimization

Optimal batch sizes depend on your workload:

// For high-throughput writes
const batch_size: u32 = 10000;

// For low-latency operations  
const batch_size: u32 = 100;

// For mixed workloads
const batch_size: u32 = 1000;

Memory Pool Sizing

Configure memory pools based on your data size:

// Large datasets (> 1GB)
const memory_pool_size: usize = 8 * 1024 * 1024 * 1024; // 8GB

// Medium datasets (100MB - 1GB)
const memory_pool_size: usize = 1 * 1024 * 1024 * 1024; // 1GB

// Small datasets (< 100MB)
const memory_pool_size: usize = 256 * 1024 * 1024; // 256MB

Comparison with Other Databases

DatabaseWrite Ops/secRead LatencyMemory Usage
NenDB1,000,0000.1μs256MB
Neo4j50,0002.3ms2GB
PostgreSQL25,0005.7ms1.5GB
Redis100,0000.5ms512MB

*Benchmarks performed on identical hardware: AMD Ryzen 9 7950X, 64GB DDR5, NVMe SSD

Was this page helpful?