A comprehensive benchmark comparing the performance of popular Rust Reed-Solomon erasure coding crates.
- reed-solomon-erasure (v6.0) - Most widely used, mature implementation
- reed-solomon-novelpoly (v2.0) - Performance-focused with novel polynomial basis
- reed-solomon-16 (v0.1) - Optimized for 16-bit operations
- reed-solomon-simd (v3.1) - SIMD-optimized implementation with O(n log n) complexity
The benchmarks test with the following configurations, where F is the number of data shards:
- F=1: 1 data + 2 coding shards (3 total)
- F=2: 2 data + 4 coding shards (6 total)
- F=3: 3 data + 6 coding shards (9 total)
- F=4: 4 data + 8 coding shards (12 total)
- F=5: 5 data + 10 coding shards (15 total)
- F=10: 10 data + 20 coding shards (30 total)
- F=20: 20 data + 40 coding shards (60 total)
- F=30: 30 data + 60 coding shards (90 total)
- F=33: 33 data + 66 coding shards (99 total)
This provides 2x redundancy - you can lose up to 2F shards and still recover the original data.
Each configuration is tested with the following data sizes:
- 256KB
- 512KB
- 1MB
Note: The full benchmark suite supports 1KB through 100MB, but for practical testing, a subset of sizes is used. Edit benches/common/mod.rs to enable all data sizes.
- Encoding: Splitting data into shards and generating parity shards
- Decoding: Reconstructing original data from partial shards
- With 1 missing shard
- With F missing shards
- With 2F missing shards (maximum recoverable)
- Verification: Checking data integrity without full decode
# Ensure you have Rust installed
rustup update# Run all benchmarks
cargo bench
# Run specific benchmark suite
cargo bench --bench encode
cargo bench --bench decode
cargo bench --bench verify# Run only encoding benchmarks for reed-solomon-erasure
cargo bench --bench encode encode_erasure
# Run only decoding benchmarks for reed-solomon-novelpoly
cargo bench --bench decode decode_novelpoly
# Run verification for reed-solomon-16
cargo bench --bench verify verify_rs16# Run benchmarks for a specific F value
cargo bench -- F10
# Run benchmarks for a specific data size
cargo bench -- 1MB
# Run benchmarks for specific crate
cargo bench -- erasureDivan outputs detailed statistics for each benchmark:
- Time: Mean execution time with standard deviation
- Throughput: Data processed per second (for applicable benchmarks)
- Comparison: Relative performance between different implementations
- Encoding Speed: How fast can data be split and parity generated?
- Decoding Speed: How fast can missing data be reconstructed?
- Scalability: How does performance change with:
- Increasing data size
- Increasing number of shards (F value)
- Increasing number of missing shards
- Small F values (1-5): Lower overhead, faster for small data
- Large F values (20-33): Better parallelization potential, more efficient for large data
- Encoding: Generally faster than decoding
- Decoding: Slower with more missing shards (more computation needed)
Based on comprehensive testing across multiple configurations:
-
🥇 reed-solomon-simd - FASTEST (0.7ms - 2.8ms)
- 10-30x faster than alternatives
- Excellent scaling with more missing shards
- Hardware-accelerated SIMD instructions
- Recommended for most use cases
-
🥈 reed-solomon-erasure - Good (1.1ms - 30ms)
- Very fast for simple cases (1-2 missing shards)
- Performance degrades with many missing shards
- Most mature and battle-tested
- Good fallback if SIMD unavailable
-
🥉 reed-solomon-16 - Moderate (3ms - 23ms)
- 3-10x slower than simd
- Consistent performance
- Uses 16-bit operations
-
reed-solomon-novelpoly - Slowest (25ms - 60ms)
- 10-30x slower than simd
- Novel polynomial basis doesn't translate to speed
- Not recommended for performance-critical applications
reed-solomon-simd ⭐ RECOMMENDED:
- ✅ Best performance across all configurations
- ✅ O(n log n) complexity using FFT-based algorithms
- ✅ Leverages SIMD instructions (SSE, AVX2, NEON)
- ✅ Scales beautifully with increasing complexity
- Use unless you have a specific reason not to
reed-solomon-erasure:
- Most mature and widely tested
- Good for simple cases with few missing shards
- Comprehensive API with verification support
- Use if SIMD is unavailable or for maximum compatibility
reed-solomon-16:
- Uses 16-bit operations instead of 8-bit
- Moderate performance
- Different memory characteristics
- Limited use cases
reed-solomon-novelpoly:
- Novel polynomial basis implementation
- Slowest performance in benchmarks
- Not recommended unless you need specific features
Record your hardware specifications when running benchmarks:
# Linux
lscpu
free -h
# macOS
sysctl -n machdep.cpu.brand_string
sysctl hw.memsize
# Windows
wmic cpu get name
wmic computersystem get totalphysicalmemoryDivan outputs results directly to the terminal with detailed statistics including:
- Fastest, slowest, median, and mean execution times
- Number of samples and iterations
- Easy-to-read tree format showing all configurations
Example output:
decode_simd
├─ decode_1_missing
│ ├─ BenchConfig { f: 10, data_size: 1048576 } 1.587 ms │ 5.702 ms │ 1.739 ms │ 1.925 ms │ 100 │ 100
To add a new Reed-Solomon crate to the benchmark:
- Add the crate to
Cargo.tomldependencies - Create a new benchmark group in each of
encode.rs,decode.rs, andverify.rs - Follow the existing pattern for consistency
- Update this README with the new crate information
This benchmark suite is provided as-is for performance comparison purposes.
- Benchmarks use deterministic data generation for reproducibility
- Each benchmark is run multiple times to ensure statistical significance
- Results may vary based on hardware, OS, and system load
- For production use, always test with your specific use case and data patterns