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
Database | Write Ops/sec | Read Latency | Memory Usage |
---|---|---|---|
NenDB | 1,000,000 | 0.1μs | 256MB |
Neo4j | 50,000 | 2.3ms | 2GB |
PostgreSQL | 25,000 | 5.7ms | 1.5GB |
Redis | 100,000 | 0.5ms | 512MB |
*Benchmarks performed on identical hardware: AMD Ryzen 9 7950X, 64GB DDR5, NVMe SSD