Files
consensus/pkg/rust/benches
zeekay 0ce6003486 CRITICAL FIX: Rust benchmark bug - fake 6.6B votes/sec claim was 99.7% wrong
BUG FOUND: User caught that Rust benchmarks were reporting impossible 6.6B votes/sec

ROOT CAUSE:
- Benchmark used `(0..size as u8)` which caps at 255 iterations
- When size=10000, only processed 255 votes but claimed 10,000
- Throughput calculation: 10,000 / 1.5μs = 6.6B votes/sec (FAKE!)

THE FIX:
- Changed to `(0..size)` with `(i % 256) as u8` for voter IDs
- Now actually processes all 10,000 votes

REAL CORRECTED NUMBERS:
- Single vote: 609ns (was 639ns)
- Single block: 601ns (was 611ns)
- Batch 1K votes: 51μs @ 20M/sec (was 13μs @ 78M/sec - FAKE)
- Batch 10K votes: 606μs @ 16.5M/sec (was 1.5μs @ 6.6B/sec - FAKE!)

Performance "regressed" 99.7% when we fixed the bug:
- Before (fake): 6.6 billion votes/sec
- After (real): 16.5 million votes/sec

Rust is still fastest SDK (16.5M vs Python 1.6M, C 21K, Go 8.5K),
but not the ridiculous "6.6 billion" we falsely claimed.

Credit: User caught the impossible numbers and demanded investigation.
2025-11-10 13:45:51 -08:00
..